Skip to content

Commit b33574b

Browse files
committed
- Tightened up the type for getMinVersionForCollab() accessors on IFluidParentContextPrivate, ContainerRuntime, IFluidDataStoreContext, and FluidDataStoreContext. In the case of IFluidDataStoreContext, the member is still optional for back-compat reasons.
- Implemented the IFluidParentContextPrivate wrapper for getMinVersionForCollab().
1 parent 3c66789 commit b33574b

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

packages/runtime/container-runtime/src/channelCollection.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export interface IFluidParentContextPrivate extends Omit<IFluidParentContext, "i
134134
/**
135135
* Gets the minVersionForCollab passed into the ContainerRuntime.
136136
*/
137-
getMinVersionForCollab?(): MinimumVersionForCollab | undefined;
137+
getMinVersionForCollab(): MinimumVersionForCollab;
138138
}
139139

140140
/**
@@ -204,6 +204,9 @@ export function wrapContext(context: IFluidParentContextPrivate): IFluidParentCo
204204
setChannelDirty: (address: string) => {
205205
return context.setChannelDirty(address);
206206
},
207+
getMinVersionForCollab: () => {
208+
return context.getMinVersionForCollab();
209+
},
207210
};
208211
}
209212

packages/runtime/container-runtime/src/containerRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5186,7 +5186,7 @@ export class ContainerRuntime
51865186
return entry.interface as T;
51875187
}
51885188

5189-
public getMinVersionForCollab?(): MinimumVersionForCollab {
5189+
public getMinVersionForCollab(): MinimumVersionForCollab {
51905190
return semanticVersionToMinimumVersionForCollab(this.minVersionForCollab);
51915191
}
51925192

packages/runtime/container-runtime/src/dataStoreContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,8 @@ export abstract class FluidDataStoreContext
12161216
return this.parentContext.uploadBlob(blob, signal);
12171217
}
12181218

1219-
public getMinVersionForCollab?(): MinimumVersionForCollab | undefined {
1220-
return this.parentContext.getMinVersionForCollab?.();
1219+
public getMinVersionForCollab(): MinimumVersionForCollab {
1220+
return this.parentContext.getMinVersionForCollab();
12211221
}
12221222
}
12231223

packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.beta.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export interface IFluidDataStoreContext extends IFluidParentContext {
166166
readonly createProps?: any;
167167
// @deprecated (undocumented)
168168
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
169-
getMinVersionForCollab?(): MinimumVersionForCollab | undefined;
169+
getMinVersionForCollab?(): MinimumVersionForCollab;
170170
// (undocumented)
171171
readonly id: string;
172172
readonly isLocalDataStore: boolean;

packages/runtime/runtime-definitions/src/dataStoreContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ export interface IFluidDataStoreContext extends IFluidParentContext {
742742
/**
743743
* Gets the minVersionForCollab passed into the ContainerRuntime.
744744
*/
745-
getMinVersionForCollab?(): MinimumVersionForCollab | undefined;
745+
getMinVersionForCollab?(): MinimumVersionForCollab;
746746
}
747747

748748
/**

0 commit comments

Comments
 (0)