Replace any
with unknown
and fix an any
->void
return type in the shared-object-base package
#23236
Labels
any
with unknown
and fix an any
->void
return type in the shared-object-base package
#23236
Affected APIs
any
->unknown
IFluidSerializer.encode(...)
now takesvalue: unknown
instead ofvalue: any
and returnsunknown
instead ofany
.IFluidSerializer.decode(...)
now takesinput: unknown
instead ofinput: any
and returnsunknown
instead ofany
.IFluidSerializer.stringify(...)
now takesvalue: unknown
instead ofvalue: any
.IFluidSerializer.parse(...)
now returnsunknown
instead ofany
.SharedObjectCore.applyStashedOps(...)
now takescontent: unknown
instead ofcontent: any
.SharedObjectCore.rollback(...)
now takescontent: unknown
instead ofcontent: any
.SharedObjectCore.submitLocalMessage(...)
now takescontent: unknown
instead ofcontent: any
.SharedObjectCore.reSubmitCore(...)
now takescontent: unknown
instead ofcontent: any
.SharedObjectCore.newAckBasedPromise<T>(...)
theexecutor
parameter now takesreject: (reason?: unknown)
instead ofreject: (reason?: any)
.makeHandlesSerializable(...)
now returnsunknown
instead ofany
.parseHandles(...)
now returnsunknown
instead ofany
.any
->void
SharedObjectCore.processCore(...)
now returnsvoid
instead ofany
.SharedObjectCore.onDisconnect(...)
now returnsvoid
instead ofany
.Context
To improve type safety of the Fluid Framework API surface, we're moving away from using the
any
type in favor ofunknown
. This issue tracks such updates for the API surface of the@fliuidframework/shared-object-base
package.Approach
We're replacing any instances of the
any
type in the API surface withunknown
.PR: #23238 and
test/
branchTwo exceptions are where the correct return type is
void
instead ofany
.Dependencies
N/A
Compatibility Concerns
Consumer of Fluid using the affected APIs might need to update their code to do additional validations or type casts.
Phases
From Fluid's side, updating the types is the only step left. For consumers, potential work will come when they consume this change.
Open Questions
N/A
The text was updated successfully, but these errors were encountered: