@fluidframework/id-compressor 2.91.0 → 2.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/api-report/id-compressor.legacy.beta.api.md +8 -1
  3. package/dist/idCompressor.d.ts +67 -0
  4. package/dist/idCompressor.d.ts.map +1 -1
  5. package/dist/idCompressor.js +43 -28
  6. package/dist/idCompressor.js.map +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +3 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/legacy.d.ts +3 -2
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.js +1 -1
  14. package/dist/packageVersion.js.map +1 -1
  15. package/dist/public.d.ts +1 -1
  16. package/dist/test/idCompressor.spec.js.map +1 -1
  17. package/dist/test/types/validateIdCompressorPrevious.generated.d.ts +6 -0
  18. package/dist/test/types/validateIdCompressorPrevious.generated.d.ts.map +1 -0
  19. package/dist/test/types/validateIdCompressorPrevious.generated.js +7 -0
  20. package/dist/test/types/validateIdCompressorPrevious.generated.js.map +1 -0
  21. package/dist/types/idCompressor.d.ts +28 -0
  22. package/dist/types/idCompressor.d.ts.map +1 -1
  23. package/dist/types/idCompressor.js.map +1 -1
  24. package/eslint.config.mts +1 -1
  25. package/internal.d.ts +1 -1
  26. package/legacy.d.ts +1 -1
  27. package/lib/idCompressor.d.ts +67 -0
  28. package/lib/idCompressor.d.ts.map +1 -1
  29. package/lib/idCompressor.js +40 -27
  30. package/lib/idCompressor.js.map +1 -1
  31. package/lib/index.d.ts +1 -1
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/legacy.d.ts +3 -2
  36. package/lib/packageVersion.d.ts +1 -1
  37. package/lib/packageVersion.js +1 -1
  38. package/lib/packageVersion.js.map +1 -1
  39. package/lib/public.d.ts +1 -1
  40. package/lib/test/idCompressor.spec.js.map +1 -1
  41. package/lib/test/types/validateIdCompressorPrevious.generated.d.ts +6 -0
  42. package/lib/test/types/validateIdCompressorPrevious.generated.d.ts.map +1 -0
  43. package/lib/test/types/validateIdCompressorPrevious.generated.js +6 -0
  44. package/lib/test/types/validateIdCompressorPrevious.generated.js.map +1 -0
  45. package/lib/tsdoc-metadata.json +1 -1
  46. package/lib/types/idCompressor.d.ts +28 -0
  47. package/lib/types/idCompressor.d.ts.map +1 -1
  48. package/lib/types/idCompressor.js.map +1 -1
  49. package/package.json +18 -17
  50. package/src/idCompressor.ts +114 -29
  51. package/src/index.ts +6 -1
  52. package/src/packageVersion.ts +1 -1
  53. package/src/test/types/validateIdCompressorPrevious.generated.ts +234 -0
  54. package/src/types/idCompressor.ts +29 -0
@@ -0,0 +1,234 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate typetests" from @fluid-tools/build-cli.
9
+ *
10
+ * Baseline (previous) version: 2.92.0
11
+ */
12
+
13
+ import type { TypeOnly, MinimalType, FullType, requireAssignableTo } from "@fluidframework/build-tools";
14
+ import type * as old from "@fluidframework/id-compressor-previous/legacy";
15
+
16
+ import type * as current from "@fluidframework/id-compressor/legacy";
17
+
18
+ declare type MakeUnusedImportErrorsGoAway<T> = TypeOnly<T> | MinimalType<T> | FullType<T> | typeof old | typeof current | requireAssignableTo<true, true>;
19
+
20
+ /*
21
+ * Validate backward compatibility by using the current type in place of the old type.
22
+ * If this test starts failing, it indicates a change that is not backward compatible.
23
+ * To acknowledge the breaking change, add the following to package.json under
24
+ * typeValidation.broken:
25
+ * "Function_createIdCompressor": {"backCompat": false}
26
+ */
27
+ declare type current_as_old_for_Function_createIdCompressor = requireAssignableTo<TypeOnly<typeof current.createIdCompressor>, TypeOnly<typeof old.createIdCompressor>>
28
+
29
+ /*
30
+ * Validate backward compatibility by using the current type in place of the old type.
31
+ * If this test starts failing, it indicates a change that is not backward compatible.
32
+ * To acknowledge the breaking change, add the following to package.json under
33
+ * typeValidation.broken:
34
+ * "Function_createSessionId": {"backCompat": false}
35
+ */
36
+ declare type current_as_old_for_Function_createSessionId = requireAssignableTo<TypeOnly<typeof current.createSessionId>, TypeOnly<typeof old.createSessionId>>
37
+
38
+ /*
39
+ * Validate backward compatibility by using the current type in place of the old type.
40
+ * If this test starts failing, it indicates a change that is not backward compatible.
41
+ * To acknowledge the breaking change, add the following to package.json under
42
+ * typeValidation.broken:
43
+ * "Function_deserializeIdCompressor": {"backCompat": false}
44
+ */
45
+ declare type current_as_old_for_Function_deserializeIdCompressor = requireAssignableTo<TypeOnly<typeof current.deserializeIdCompressor>, TypeOnly<typeof old.deserializeIdCompressor>>
46
+
47
+ /*
48
+ * Validate backward compatibility by using the current type in place of the old type.
49
+ * If this test starts failing, it indicates a change that is not backward compatible.
50
+ * To acknowledge the breaking change, add the following to package.json under
51
+ * typeValidation.broken:
52
+ * "Function_serializeIdCompressor": {"backCompat": false}
53
+ */
54
+ declare type current_as_old_for_Function_serializeIdCompressor = requireAssignableTo<TypeOnly<typeof current.serializeIdCompressor>, TypeOnly<typeof old.serializeIdCompressor>>
55
+
56
+ /*
57
+ * Validate forward compatibility by using the old type in place of the current type.
58
+ * If this test starts failing, it indicates a change that is not forward compatible.
59
+ * To acknowledge the breaking change, add the following to package.json under
60
+ * typeValidation.broken:
61
+ * "Interface_IdCreationRange": {"forwardCompat": false}
62
+ */
63
+ declare type old_as_current_for_Interface_IdCreationRange = requireAssignableTo<TypeOnly<old.IdCreationRange>, TypeOnly<current.IdCreationRange>>
64
+
65
+ /*
66
+ * Validate backward compatibility by using the current type in place of the old type.
67
+ * If this test starts failing, it indicates a change that is not backward compatible.
68
+ * To acknowledge the breaking change, add the following to package.json under
69
+ * typeValidation.broken:
70
+ * "Interface_IdCreationRange": {"backCompat": false}
71
+ */
72
+ declare type current_as_old_for_Interface_IdCreationRange = requireAssignableTo<TypeOnly<current.IdCreationRange>, TypeOnly<old.IdCreationRange>>
73
+
74
+ /*
75
+ * Validate forward compatibility by using the old type in place of the current type.
76
+ * If this test starts failing, it indicates a change that is not forward compatible.
77
+ * To acknowledge the breaking change, add the following to package.json under
78
+ * typeValidation.broken:
79
+ * "Interface_IIdCompressor": {"forwardCompat": false}
80
+ */
81
+ declare type old_as_current_for_Interface_IIdCompressor = requireAssignableTo<TypeOnly<old.IIdCompressor>, TypeOnly<current.IIdCompressor>>
82
+
83
+ /*
84
+ * Validate backward compatibility by using the current type in place of the old type.
85
+ * If this test starts failing, it indicates a change that is not backward compatible.
86
+ * To acknowledge the breaking change, add the following to package.json under
87
+ * typeValidation.broken:
88
+ * "Interface_IIdCompressor": {"backCompat": false}
89
+ */
90
+ declare type current_as_old_for_Interface_IIdCompressor = requireAssignableTo<TypeOnly<current.IIdCompressor>, TypeOnly<old.IIdCompressor>>
91
+
92
+ /*
93
+ * Validate forward compatibility by using the old type in place of the current type.
94
+ * If this test starts failing, it indicates a change that is not forward compatible.
95
+ * To acknowledge the breaking change, add the following to package.json under
96
+ * typeValidation.broken:
97
+ * "Interface_IIdCompressorCore": {"forwardCompat": false}
98
+ */
99
+ declare type old_as_current_for_Interface_IIdCompressorCore = requireAssignableTo<TypeOnly<old.IIdCompressorCore>, TypeOnly<current.IIdCompressorCore>>
100
+
101
+ /*
102
+ * Validate backward compatibility by using the current type in place of the old type.
103
+ * If this test starts failing, it indicates a change that is not backward compatible.
104
+ * To acknowledge the breaking change, add the following to package.json under
105
+ * typeValidation.broken:
106
+ * "Interface_IIdCompressorCore": {"backCompat": false}
107
+ */
108
+ declare type current_as_old_for_Interface_IIdCompressorCore = requireAssignableTo<TypeOnly<current.IIdCompressorCore>, TypeOnly<old.IIdCompressorCore>>
109
+
110
+ /*
111
+ * Validate forward compatibility by using the old type in place of the current type.
112
+ * If this test starts failing, it indicates a change that is not forward compatible.
113
+ * To acknowledge the breaking change, add the following to package.json under
114
+ * typeValidation.broken:
115
+ * "TypeAlias_OpSpaceCompressedId": {"forwardCompat": false}
116
+ */
117
+ declare type old_as_current_for_TypeAlias_OpSpaceCompressedId = requireAssignableTo<TypeOnly<old.OpSpaceCompressedId>, TypeOnly<current.OpSpaceCompressedId>>
118
+
119
+ /*
120
+ * Validate backward compatibility by using the current type in place of the old type.
121
+ * If this test starts failing, it indicates a change that is not backward compatible.
122
+ * To acknowledge the breaking change, add the following to package.json under
123
+ * typeValidation.broken:
124
+ * "TypeAlias_OpSpaceCompressedId": {"backCompat": false}
125
+ */
126
+ declare type current_as_old_for_TypeAlias_OpSpaceCompressedId = requireAssignableTo<TypeOnly<current.OpSpaceCompressedId>, TypeOnly<old.OpSpaceCompressedId>>
127
+
128
+ /*
129
+ * Validate forward compatibility by using the old type in place of the current type.
130
+ * If this test starts failing, it indicates a change that is not forward compatible.
131
+ * To acknowledge the breaking change, add the following to package.json under
132
+ * typeValidation.broken:
133
+ * "TypeAlias_SerializedIdCompressor": {"forwardCompat": false}
134
+ */
135
+ declare type old_as_current_for_TypeAlias_SerializedIdCompressor = requireAssignableTo<TypeOnly<old.SerializedIdCompressor>, TypeOnly<current.SerializedIdCompressor>>
136
+
137
+ /*
138
+ * Validate backward compatibility by using the current type in place of the old type.
139
+ * If this test starts failing, it indicates a change that is not backward compatible.
140
+ * To acknowledge the breaking change, add the following to package.json under
141
+ * typeValidation.broken:
142
+ * "TypeAlias_SerializedIdCompressor": {"backCompat": false}
143
+ */
144
+ declare type current_as_old_for_TypeAlias_SerializedIdCompressor = requireAssignableTo<TypeOnly<current.SerializedIdCompressor>, TypeOnly<old.SerializedIdCompressor>>
145
+
146
+ /*
147
+ * Validate forward compatibility by using the old type in place of the current type.
148
+ * If this test starts failing, it indicates a change that is not forward compatible.
149
+ * To acknowledge the breaking change, add the following to package.json under
150
+ * typeValidation.broken:
151
+ * "TypeAlias_SerializedIdCompressorWithNoSession": {"forwardCompat": false}
152
+ */
153
+ declare type old_as_current_for_TypeAlias_SerializedIdCompressorWithNoSession = requireAssignableTo<TypeOnly<old.SerializedIdCompressorWithNoSession>, TypeOnly<current.SerializedIdCompressorWithNoSession>>
154
+
155
+ /*
156
+ * Validate backward compatibility by using the current type in place of the old type.
157
+ * If this test starts failing, it indicates a change that is not backward compatible.
158
+ * To acknowledge the breaking change, add the following to package.json under
159
+ * typeValidation.broken:
160
+ * "TypeAlias_SerializedIdCompressorWithNoSession": {"backCompat": false}
161
+ */
162
+ declare type current_as_old_for_TypeAlias_SerializedIdCompressorWithNoSession = requireAssignableTo<TypeOnly<current.SerializedIdCompressorWithNoSession>, TypeOnly<old.SerializedIdCompressorWithNoSession>>
163
+
164
+ /*
165
+ * Validate forward compatibility by using the old type in place of the current type.
166
+ * If this test starts failing, it indicates a change that is not forward compatible.
167
+ * To acknowledge the breaking change, add the following to package.json under
168
+ * typeValidation.broken:
169
+ * "TypeAlias_SerializedIdCompressorWithOngoingSession": {"forwardCompat": false}
170
+ */
171
+ declare type old_as_current_for_TypeAlias_SerializedIdCompressorWithOngoingSession = requireAssignableTo<TypeOnly<old.SerializedIdCompressorWithOngoingSession>, TypeOnly<current.SerializedIdCompressorWithOngoingSession>>
172
+
173
+ /*
174
+ * Validate backward compatibility by using the current type in place of the old type.
175
+ * If this test starts failing, it indicates a change that is not backward compatible.
176
+ * To acknowledge the breaking change, add the following to package.json under
177
+ * typeValidation.broken:
178
+ * "TypeAlias_SerializedIdCompressorWithOngoingSession": {"backCompat": false}
179
+ */
180
+ declare type current_as_old_for_TypeAlias_SerializedIdCompressorWithOngoingSession = requireAssignableTo<TypeOnly<current.SerializedIdCompressorWithOngoingSession>, TypeOnly<old.SerializedIdCompressorWithOngoingSession>>
181
+
182
+ /*
183
+ * Validate forward compatibility by using the old type in place of the current type.
184
+ * If this test starts failing, it indicates a change that is not forward compatible.
185
+ * To acknowledge the breaking change, add the following to package.json under
186
+ * typeValidation.broken:
187
+ * "TypeAlias_SessionId": {"forwardCompat": false}
188
+ */
189
+ declare type old_as_current_for_TypeAlias_SessionId = requireAssignableTo<TypeOnly<old.SessionId>, TypeOnly<current.SessionId>>
190
+
191
+ /*
192
+ * Validate backward compatibility by using the current type in place of the old type.
193
+ * If this test starts failing, it indicates a change that is not backward compatible.
194
+ * To acknowledge the breaking change, add the following to package.json under
195
+ * typeValidation.broken:
196
+ * "TypeAlias_SessionId": {"backCompat": false}
197
+ */
198
+ declare type current_as_old_for_TypeAlias_SessionId = requireAssignableTo<TypeOnly<current.SessionId>, TypeOnly<old.SessionId>>
199
+
200
+ /*
201
+ * Validate forward compatibility by using the old type in place of the current type.
202
+ * If this test starts failing, it indicates a change that is not forward compatible.
203
+ * To acknowledge the breaking change, add the following to package.json under
204
+ * typeValidation.broken:
205
+ * "TypeAlias_SessionSpaceCompressedId": {"forwardCompat": false}
206
+ */
207
+ declare type old_as_current_for_TypeAlias_SessionSpaceCompressedId = requireAssignableTo<TypeOnly<old.SessionSpaceCompressedId>, TypeOnly<current.SessionSpaceCompressedId>>
208
+
209
+ /*
210
+ * Validate backward compatibility by using the current type in place of the old type.
211
+ * If this test starts failing, it indicates a change that is not backward compatible.
212
+ * To acknowledge the breaking change, add the following to package.json under
213
+ * typeValidation.broken:
214
+ * "TypeAlias_SessionSpaceCompressedId": {"backCompat": false}
215
+ */
216
+ declare type current_as_old_for_TypeAlias_SessionSpaceCompressedId = requireAssignableTo<TypeOnly<current.SessionSpaceCompressedId>, TypeOnly<old.SessionSpaceCompressedId>>
217
+
218
+ /*
219
+ * Validate forward compatibility by using the old type in place of the current type.
220
+ * If this test starts failing, it indicates a change that is not forward compatible.
221
+ * To acknowledge the breaking change, add the following to package.json under
222
+ * typeValidation.broken:
223
+ * "TypeAlias_StableId": {"forwardCompat": false}
224
+ */
225
+ declare type old_as_current_for_TypeAlias_StableId = requireAssignableTo<TypeOnly<old.StableId>, TypeOnly<current.StableId>>
226
+
227
+ /*
228
+ * Validate backward compatibility by using the current type in place of the old type.
229
+ * If this test starts failing, it indicates a change that is not backward compatible.
230
+ * To acknowledge the breaking change, add the following to package.json under
231
+ * typeValidation.broken:
232
+ * "TypeAlias_StableId": {"backCompat": false}
233
+ */
234
+ declare type current_as_old_for_TypeAlias_StableId = requireAssignableTo<TypeOnly<current.StableId>, TypeOnly<old.StableId>>
@@ -75,6 +75,19 @@ import type {
75
75
  *
76
76
  * These two spaces naturally define a rule: consumers of compressed IDs should use session-space IDs, but serialized forms such as ops
77
77
  * should use op-space IDs.
78
+ *
79
+ * @privateremarks To be made internal in 2.100.0
80
+ *
81
+ * @deprecated `IIdCompressorCore` will be removed from the public API in 2.100.0.
82
+ *
83
+ * - If you use `serialize()`, use the free function
84
+ * {@link (serializeIdCompressor:1) | serializeIdCompressor(compressor, withSession)} instead.
85
+ *
86
+ * - `takeNextCreationRange`, `takeUnfinalizedCreationRange`, `finalizeCreationRange`, and
87
+ * `beginGhostSession` are internal runtime operations. External consumers should not call
88
+ * them directly. If you depend on these APIs, please file an issue on the FluidFramework
89
+ * repository describing your use case.
90
+ *
78
91
  * @legacy @beta
79
92
  */
80
93
  export interface IIdCompressorCore {
@@ -97,6 +110,22 @@ export interface IIdCompressorCore {
97
110
  */
98
111
  takeUnfinalizedCreationRange(): IdCreationRange;
99
112
 
113
+ /**
114
+ * Resets the next creation range to include all unfinalized IDs.
115
+ *
116
+ * @remarks
117
+ * IMPORTANT: This must only be called if it's CERTAIN that the unfinalized range will never be finalized as-is (e.g. by in-flight ops).
118
+ *
119
+ * After calling this, the next call to {@link IIdCompressorCore.takeNextCreationRange} will produce a range
120
+ * covering all unfinalized IDs (equivalent to what {@link IIdCompressorCore.takeUnfinalizedCreationRange} would
121
+ * have returned) plus any IDs generated after this call.
122
+ *
123
+ * Unlike {@link IIdCompressorCore.takeUnfinalizedCreationRange}, this method does not produce or return a range,
124
+ * and does not advance the internal range counter. It is useful when the caller wants to
125
+ * defer the actual range submission to the next natural {@link IIdCompressorCore.takeNextCreationRange} call.
126
+ */
127
+ resetUnfinalizedCreationRange(): void;
128
+
100
129
  /**
101
130
  * Finalizes the supplied range of IDs (which may be from either a remote or local session).
102
131
  * @param range - the range of session-local IDs to finalize.