-
Notifications
You must be signed in to change notification settings - Fork 573
Expand file tree
/
Copy pathcompatibilityDefinitions.ts
More file actions
33 lines (32 loc) · 1.86 KB
/
compatibilityDefinitions.ts
File metadata and controls
33 lines (32 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Oldest version of Fluid Framework client packages to support collaborating with.
* @remarks
* String in a SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.
*
* When specifying a given `MinimumVersionForCollab`, any client with a version that is greater than or equal to the specified version will be considered compatible.
*
* Must be at least {@link @fluidframework/runtime-utils#lowestMinVersionForCollab} and cannot exceed the current version.
*
* {@link @fluidframework/runtime-utils#validateMinimumVersionForCollab} can be used to check these invariants at runtime.
* Since TypeScript cannot enforce them all for literals in code,
* it may be useful to use `validateMinimumVersionForCollab` values which may come from constants in the codebase typed as a `MinimumVersionForCollab`.
*
* @privateRemarks
* Since this uses the semver notion of "greater" (which might not actually mean a later release, or supporting more features), care must be taken with how this is used.
* See remarks for {@link @fluidframework/runtime-utils#MinimumMinorSemanticVersion} for more details.
*
* Since this type is marked with `@input`, it can be generalized to allow more cases in the future as a non-breaking change.
*
* TODO: before stabilizing this further, some restrictions should be considered (since once stabilized, this can be relaxed, but not more constrained).
* For example it might make sense to constrain this to something like `"1.4.0" | typeof defaultMinVersionForCollab | 2.${bigint}.0"`.
*
* @input
* @beta
*/
export type MinimumVersionForCollab =
| `${1 | 2}.${bigint}.${bigint}`
| `${1 | 2}.${bigint}.${bigint}-${string}`;