uni-types 1.7.0 → 1.9.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.
- package/README.md +261 -1
- package/dist/index.d.cts +17653 -8320
- package/dist/index.d.mts +17653 -8320
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ A comprehensive collection of type helpers for TypeScript development
|
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
|
-
- 🎯 **
|
|
21
|
+
- 🎯 **1500+ Type Utilities** - Comprehensive type helpers for every use case
|
|
22
22
|
- 🔒 **Type Safe** - Full TypeScript support with strict type checking
|
|
23
23
|
- 📦 **Zero Dependencies** - Lightweight and tree-shakeable
|
|
24
24
|
- 🚀 **TypeScript 5.x** - Built with the latest TypeScript features
|
|
@@ -1017,6 +1017,116 @@ type Result = If<true, 'success', 'error'> // 'success'
|
|
|
1017
1017
|
| `Mean<T>`, `Median<T>` | Statistical functions |
|
|
1018
1018
|
| `IsEven<N>`, `IsOdd<N>` | Even/Odd check |
|
|
1019
1019
|
|
|
1020
|
+
### Type Inference Engine *(v1.8.0)*
|
|
1021
|
+
|
|
1022
|
+
| Type | Description |
|
|
1023
|
+
|------|-------------|
|
|
1024
|
+
| `InferEngine<T>` | Type inference engine |
|
|
1025
|
+
| `InferContext<T>` | Inference context with type variables |
|
|
1026
|
+
| `InferResult<T>` | Inference result (success/error) |
|
|
1027
|
+
| `Deduce<T>` | Type deduction utility |
|
|
1028
|
+
| `Constraint<T>` | Type constraint definition |
|
|
1029
|
+
| `Substitution<T>` | Type substitution |
|
|
1030
|
+
| `TypeVar` | Type variable representation |
|
|
1031
|
+
| `Polymorphic<T>` | Polymorphic type |
|
|
1032
|
+
| `Kind`, `KindArrow`, `KindCheck<T>` | Kind system |
|
|
1033
|
+
| `Effect<T>`, `EffectRow`, `Effectful<T>` | Effect system |
|
|
1034
|
+
| `Pure<T>`, `Impure<T>` | Pure/impure computations |
|
|
1035
|
+
|
|
1036
|
+
### Type-Level Network *(v1.8.0)*
|
|
1037
|
+
|
|
1038
|
+
| Type | Description |
|
|
1039
|
+
|------|-------------|
|
|
1040
|
+
| `Protocol`, `ProtocolVersion` | Protocol definition |
|
|
1041
|
+
| `HTTPMethod`, `HTTPHeaders` | HTTP types |
|
|
1042
|
+
| `HTTPRequest<T>`, `HTTPResponse<T>` | HTTP request/response |
|
|
1043
|
+
| `WSMessage<T>`, `WSFrame`, `WSOpcode` | WebSocket types |
|
|
1044
|
+
| `gRPCService`, `gRPCMethod<T>`, `gRPCRequest<T>` | gRPC types |
|
|
1045
|
+
| `TCPPacket<T>`, `UDPPacket<T>`, `SocketAddress` | TCP/UDP types |
|
|
1046
|
+
| `ProtoMessage`, `ProtoField<T>` | Protocol Buffers |
|
|
1047
|
+
| `MQTTPacket<T>`, `MQTTQoS` | MQTT types |
|
|
1048
|
+
|
|
1049
|
+
### Type-Level File System *(v1.8.0)*
|
|
1050
|
+
|
|
1051
|
+
| Type | Description |
|
|
1052
|
+
|------|-------------|
|
|
1053
|
+
| `Path`, `AbsolutePath`, `RelativePath` | Path types |
|
|
1054
|
+
| `ParsePath<P>`, `JoinPath<P1, P2>` | Path operations |
|
|
1055
|
+
| `File`, `FileContent<T>`, `FileType` | File types |
|
|
1056
|
+
| `Directory`, `DirectoryEntry<T>` | Directory types |
|
|
1057
|
+
| `FileWatch<T>`, `WatchEvent<T>` | File watching |
|
|
1058
|
+
| `VirtualFS<T>`, `VFSNode<T>` | Virtual file system |
|
|
1059
|
+
| `Archive`, `ArchiveFormat` | Archive types |
|
|
1060
|
+
| `MimeType`, `FileMetadata` | File metadata |
|
|
1061
|
+
|
|
1062
|
+
### Type-Level Compiler *(v1.8.0)*
|
|
1063
|
+
|
|
1064
|
+
| Type | Description |
|
|
1065
|
+
|------|-------------|
|
|
1066
|
+
| `CompilerPlugin<T>` | Compiler plugin |
|
|
1067
|
+
| `Macro<T>`, `MacroExpansion<T>` | Macro system |
|
|
1068
|
+
| `Diagnostic`, `DiagnosticLevel` | Compiler diagnostics |
|
|
1069
|
+
| `SymbolTable`, `CompilerSymbol` | Symbol management |
|
|
1070
|
+
| `Visitor<T>`, `TransformPass<T>` | AST visitor pattern |
|
|
1071
|
+
|
|
1072
|
+
### Type-Level Debugging *(v1.8.0)*
|
|
1073
|
+
|
|
1074
|
+
| Type | Description |
|
|
1075
|
+
|------|-------------|
|
|
1076
|
+
| `DebugSession`, `DebugStatus` | Debug session |
|
|
1077
|
+
| `Breakpoint`, `BreakpointLocation` | Breakpoint types |
|
|
1078
|
+
| `StackTrace`, `DebugStackFrame` | Stack trace |
|
|
1079
|
+
| `Variable`, `VariableValue` | Variable inspection |
|
|
1080
|
+
| `MemoryRegion`, `MemoryAddress` | Memory debugging |
|
|
1081
|
+
| `DebugProtocol` | Debug protocol (DAP) |
|
|
1082
|
+
| `REPL`, `REPLCommand<T>` | REPL interface |
|
|
1083
|
+
|
|
1084
|
+
### Type-Level Optimizer *(v1.8.0)*
|
|
1085
|
+
|
|
1086
|
+
| Type | Description |
|
|
1087
|
+
|------|-------------|
|
|
1088
|
+
| `Optimization<T>`, `OptimizationLevel` | Optimization types |
|
|
1089
|
+
| `TreeShake<T>`, `ShallowResult<T>` | Tree shaking |
|
|
1090
|
+
| `DeadCode`, `DeadCodeAnalysis<T>` | Dead code elimination |
|
|
1091
|
+
| `Inline<T>`, `InlineCandidate<T>` | Function inlining |
|
|
1092
|
+
| `ConstantFold<T>` | Constant folding |
|
|
1093
|
+
| `MinifyType<T>` | Type minification |
|
|
1094
|
+
| `PerformanceHint<T>` | Optimization hints |
|
|
1095
|
+
|
|
1096
|
+
### Type-Level Docgen *(v1.8.0)*
|
|
1097
|
+
|
|
1098
|
+
| Type | Description |
|
|
1099
|
+
|------|-------------|
|
|
1100
|
+
| `Documentation<T>`, `DocGenEntry<T>` | Documentation structure |
|
|
1101
|
+
| `JSDoc<T>`, `JSDocTag<T>` | JSDoc parsing |
|
|
1102
|
+
| `APIDoc<T>`, `APIEndpoint<T>` | API documentation |
|
|
1103
|
+
| `DocSearch<T>`, `SearchIndex` | Documentation search |
|
|
1104
|
+
| `DocNavigation<T>`, `DocSidebar<T>` | Documentation navigation |
|
|
1105
|
+
| `DocFormat` | Output format (markdown, html, json) |
|
|
1106
|
+
|
|
1107
|
+
### Type-Level Test Framework *(v1.8.0)*
|
|
1108
|
+
|
|
1109
|
+
| Type | Description |
|
|
1110
|
+
|------|-------------|
|
|
1111
|
+
| `TestGroup`, `TestSetup`, `TestTeardown` | Test organization |
|
|
1112
|
+
| `Assert`, `AssertExtends<T, U>` | Type assertions |
|
|
1113
|
+
| `MockFunction`, `TimerMock` | Mock utilities |
|
|
1114
|
+
| `CoverageProvider`, `CoverageReporter` | Coverage types |
|
|
1115
|
+
| `SnapshotSerializer` | Snapshot serialization |
|
|
1116
|
+
| `Worker`, `WorkerPool` | Parallel test execution |
|
|
1117
|
+
|
|
1118
|
+
### Type-Level Package Manager *(v1.8.0)*
|
|
1119
|
+
|
|
1120
|
+
| Type | Description |
|
|
1121
|
+
|------|-------------|
|
|
1122
|
+
| `PkgPackage<T>`, `PackageName` | Package types |
|
|
1123
|
+
| `Dependencies`, `Dependency<T>` | Dependency types |
|
|
1124
|
+
| `SemVer`, `SemVerRange`, `SemVerDiff` | SemVer types |
|
|
1125
|
+
| `LockFile<T>`, `LockFormat` | Lock file types |
|
|
1126
|
+
| `Workspace<T>`, `WorkspaceGraph<T>` | Workspace/monorepo |
|
|
1127
|
+
| `RegistryAuth`, `RegistryPackage<T>` | Registry types |
|
|
1128
|
+
| `Vulnerability` | Security vulnerability |
|
|
1129
|
+
|
|
1020
1130
|
### Type-Level Search *(v1.7.0)*
|
|
1021
1131
|
|
|
1022
1132
|
| Type | Description |
|
|
@@ -1038,6 +1148,156 @@ type Result = If<true, 'success', 'error'> // 'success'
|
|
|
1038
1148
|
| `Flatten<T>` | Flatten nested tuples |
|
|
1039
1149
|
| `MinElement<T>`, `MaxElement<T>` | Min/Max element |
|
|
1040
1150
|
|
|
1151
|
+
### Quantum Computing *(v1.9.0)*
|
|
1152
|
+
|
|
1153
|
+
| Type | Description |
|
|
1154
|
+
|------|-------------|
|
|
1155
|
+
| `Qubit<T>`, `QubitState`, `QubitArray<N, T>` | Qubit types |
|
|
1156
|
+
| `QuantumGate`, `Hadamard`, `PauliX/Y/Z` | Quantum gates |
|
|
1157
|
+
| `CNOT`, `Toffoli`, `PhaseGate` | Multi-qubit gates |
|
|
1158
|
+
| `QuantumCircuit<N>`, `CircuitGate<T>` | Circuit types |
|
|
1159
|
+
| `QuantumRegister<N>`, `ClassicalRegister<N>` | Register types |
|
|
1160
|
+
| `QuantumState<N>`, `StateVector<N>` | State representation |
|
|
1161
|
+
| `BellState`, `GHZState<N>`, `EntangledPair` | Entanglement types |
|
|
1162
|
+
| `Grover<T>`, `Shor`, `QFT<N>`, `VQE`, `QAOA` | Quantum algorithms |
|
|
1163
|
+
| `QuantumHardware`, `QuantumBackend` | Hardware types |
|
|
1164
|
+
|
|
1165
|
+
### Game Development *(v1.9.0)*
|
|
1166
|
+
|
|
1167
|
+
| Type | Description |
|
|
1168
|
+
|------|-------------|
|
|
1169
|
+
| `Entity<T>`, `EntityId`, `EntityComponent<T>` | Entity types |
|
|
1170
|
+
| `Component`, `Position2D/3D`, `Velocity` | Component types |
|
|
1171
|
+
| `GameState<T>`, `GameAction<T>`, `GameStore<T>` | State management |
|
|
1172
|
+
| `InputState`, `KeyboardState`, `MouseState`, `GamepadState` | Input handling |
|
|
1173
|
+
| `PhysicsBody<T>`, `ColliderShape`, `Collision<T>` | Physics types |
|
|
1174
|
+
| `Scene<T>`, `SceneNode<T>`, `Camera<T>` | Scene graph |
|
|
1175
|
+
| `Material`, `Shader`, `Texture`, `Mesh` | Rendering types |
|
|
1176
|
+
| `AudioClip`, `AudioSource`, `AudioListener` | Audio types |
|
|
1177
|
+
| `Level`, `SpawnPoint`, `Checkpoint`, `Objective` | Level design |
|
|
1178
|
+
|
|
1179
|
+
### Blockchain *(v1.9.0)*
|
|
1180
|
+
|
|
1181
|
+
| Type | Description |
|
|
1182
|
+
|------|-------------|
|
|
1183
|
+
| `Block<T>`, `BlockHeader`, `BlockBody` | Block types |
|
|
1184
|
+
| `Transaction`, `LegacyTransaction`, `EIP1559Transaction` | Transaction types |
|
|
1185
|
+
| `SmartContract<A>`, `ContractABI` | Smart contract types |
|
|
1186
|
+
| `Address`, `PublicKey`, `PrivateKey`, `Signature` | Address/crypto types |
|
|
1187
|
+
| `TokenInfo`, `FungibleTokenBalance`, `NonFungibleToken` | Token types |
|
|
1188
|
+
| `WalletAccount`, `WalletConnection`, `WalletProvider` | Wallet types |
|
|
1189
|
+
| `Chain`, `ChainId`, `NetworkConfig` | Network types |
|
|
1190
|
+
| `GasEstimate`, `GasPrice`, `GasFees` | Gas types |
|
|
1191
|
+
| `JsonRpcProvider`, `JsonRpcRequest` | JSON-RPC types |
|
|
1192
|
+
|
|
1193
|
+
### Language Processing *(v1.9.0)*
|
|
1194
|
+
|
|
1195
|
+
| Type | Description |
|
|
1196
|
+
|------|-------------|
|
|
1197
|
+
| `Token<T>`, `TokenType`, `TokenStream<T>` | Tokenization |
|
|
1198
|
+
| `Sentence<T>`, `Paragraph<S>`, `Document<P>` | Document structure |
|
|
1199
|
+
| `ParseTree`, `ParseNode<T>`, `Grammar` | Parsing types |
|
|
1200
|
+
| `LanguageModel<T>`, `Vocabulary<T>`, `Embedding<T>` | Language models |
|
|
1201
|
+
| `SemanticRole`, `SemanticFrame`, `EntityMention` | Semantic analysis |
|
|
1202
|
+
| `Morpheme`, `PartOfSpeech`, `MorphologicalFeatures` | Morphology |
|
|
1203
|
+
| `SentimentResult`, `EmotionResult` | Sentiment analysis |
|
|
1204
|
+
| `TranslationResult`, `Locale`, `LanguagePair` | Translation types |
|
|
1205
|
+
| `ClassificationResult`, `TopicInfo`, `QAResult` | Classification/QA |
|
|
1206
|
+
|
|
1207
|
+
### Graphics *(v1.9.0)*
|
|
1208
|
+
|
|
1209
|
+
| Type | Description |
|
|
1210
|
+
|------|-------------|
|
|
1211
|
+
| `Color`, `RGB`, `RGBA`, `HSL`, `HexColor` | Color types |
|
|
1212
|
+
| `Vector2/3/4`, `Point2D/3D`, `Size2D/3D` | Vector types |
|
|
1213
|
+
| `Matrix2x2`, `Matrix3x3`, `Matrix4x4`, `Quaternion` | Matrix types |
|
|
1214
|
+
| `Transform`, `Translation`, `Rotation`, `Scale` | Transform types |
|
|
1215
|
+
| `Point`, `Line`, `Triangle`, `Quad`, `Polygon` | Primitive types |
|
|
1216
|
+
| `Circle`, `Rectangle`, `Sphere`, `Box` | Shape types |
|
|
1217
|
+
| `VertexBuffer`, `IndexBuffer`, `UniformBuffer` | Buffer types |
|
|
1218
|
+
| `VertexShader`, `FragmentShader`, `ComputeShader` | Shader types |
|
|
1219
|
+
| `Texture`, `SamplerDescriptor`, `TextureFormat` | Texture types |
|
|
1220
|
+
| `RenderPipeline`, `ComputePipeline` | Pipeline types |
|
|
1221
|
+
| `Light`, `DirectionalLight`, `PointLight`, `SpotLight` | Light types |
|
|
1222
|
+
|
|
1223
|
+
### Audio Processing *(v1.9.0)*
|
|
1224
|
+
|
|
1225
|
+
| Type | Description |
|
|
1226
|
+
|------|-------------|
|
|
1227
|
+
| `AudioSample`, `AudioBufferData`, `AudioChannel` | Audio data |
|
|
1228
|
+
| `SampleRate`, `BitDepth`, `SampleFormat` | Format types |
|
|
1229
|
+
| `WaveformType`, `ADSREnvelope`, `Envelope` | Waveform/envelope |
|
|
1230
|
+
| `Frequency`, `NoteName`, `Octave`, `NotePitch` | Musical pitch |
|
|
1231
|
+
| `ReverbEffect`, `DelayEffect`, `FilterEffect` | Audio effects |
|
|
1232
|
+
| `CompressorEffect`, `EqualizerEffect`, `DistortionEffect` | More effects |
|
|
1233
|
+
| `MIDINote`, `MIDIEvent`, `MIDISequence`, `MIDITrack` | MIDI types |
|
|
1234
|
+
| `OscillatorOptions`, `LFOOptions`, `SynthesizerPatch` | Synthesizer types |
|
|
1235
|
+
| `FFTResult`, `Spectrum`, `Spectrogram` | Analysis types |
|
|
1236
|
+
| `AudioFormat`, `AudioEncodingOptions`, `AudioMetadata` | Encoding types |
|
|
1237
|
+
|
|
1238
|
+
### Animation *(v1.9.0)*
|
|
1239
|
+
|
|
1240
|
+
| Type | Description |
|
|
1241
|
+
|------|-------------|
|
|
1242
|
+
| `Animation<T>`, `AnimationFrame<T>`, `AnimationTimeline<T>` | Animation core |
|
|
1243
|
+
| `Keyframe<T>`, `KeyframeSequence<T>`, `KeyframeInterpolation` | Keyframe types |
|
|
1244
|
+
| `EasingType`, `EasingPreset`, `CubicBezier`, `StepsEasing` | Easing types |
|
|
1245
|
+
| `Transition<T>`, `TransitionShorthand` | CSS transitions |
|
|
1246
|
+
| `SpringConfig`, `SpringState`, `SpringPreset` | Spring physics |
|
|
1247
|
+
| `SpriteSheet`, `SpriteFrame`, `SpriteAnimation` | Sprite animation |
|
|
1248
|
+
| `MorphTarget`, `MorphWeights`, `MorphAnimation` | Morph targets |
|
|
1249
|
+
| `Skeleton`, `Bone`, `Joint`, `Pose` | Skeletal animation |
|
|
1250
|
+
| `AnimationState`, `AnimationTransition`, `AnimationLayer` | State machine |
|
|
1251
|
+
| `IKChain`, `IKTarget`, `IKSolverType` | Inverse kinematics |
|
|
1252
|
+
| `AnimationTrack`, `AnimationClip`, `AnimationEvent` | Timeline types |
|
|
1253
|
+
|
|
1254
|
+
### Error Handling *(v1.9.0)*
|
|
1255
|
+
|
|
1256
|
+
| Type | Description |
|
|
1257
|
+
|------|-------------|
|
|
1258
|
+
| `Result<T, E>`, `Success<T>`, `Failure<E>` | Result type |
|
|
1259
|
+
| `Ok<T>`, `Err<E>`, `AsyncResult<T, E>` | Result helpers |
|
|
1260
|
+
| `Try<T, E>`, `TryResult<T>`, `CatchHandler<T, E>` | Try-catch types |
|
|
1261
|
+
| `Either<L, R>`, `Left<L>`, `Right<R>` | Either type |
|
|
1262
|
+
| `Option<T>`, `Some<T>`, `None` | Option type |
|
|
1263
|
+
| `ErrorChain<T>`, `ChainLink<T>` | Error chain |
|
|
1264
|
+
| `RecoveryStrategy`, `RecoveryOptions<T>`, `RetryConfig` | Recovery types |
|
|
1265
|
+
| `ValidationError<T>`, `FieldError<T>`, `ValidationResult<T>` | Validation errors |
|
|
1266
|
+
| `NetworkError`, `AuthenticationError`, `NotFoundError` | Domain errors |
|
|
1267
|
+
| `Panic`, `FatalError`, `BusinessError`, `SystemError` | Error categories |
|
|
1268
|
+
|
|
1269
|
+
### Event System *(v1.9.0)*
|
|
1270
|
+
|
|
1271
|
+
| Type | Description |
|
|
1272
|
+
|------|-------------|
|
|
1273
|
+
| `Event<T>`, `TypedEvent<K, V>`, `EventMap` | Event types |
|
|
1274
|
+
| `EventEmitter<T>`, `EventHandler<T>` | Emitter types |
|
|
1275
|
+
| `EventBus<T>`, `BusEvent<T>`, `EventBusMiddleware` | Event bus |
|
|
1276
|
+
| `EventDispatcher<T>`, `DispatchResult<T>` | Dispatcher types |
|
|
1277
|
+
| `EventQueue<T>`, `QueuedEvent<T>`, `QueuePriority` | Queue types |
|
|
1278
|
+
| `Subscription`, `SubscriptionOptions<T>`, `SubscriptionFilter<T>` | Subscription |
|
|
1279
|
+
| `EventPattern`, `PatternMatch<T>`, `PatternResult<T>` | Pattern matching |
|
|
1280
|
+
| `EventAggregator<T>`, `AggregatedEvent<T>` | Aggregation types |
|
|
1281
|
+
| `EventHistory<T>`, `ReplayOptions<T>` | History types |
|
|
1282
|
+
| `DomainEvent<A, T>`, `EventSourcedAggregate<I>` | Domain events |
|
|
1283
|
+
|
|
1284
|
+
### Reactive Programming *(v1.9.0)*
|
|
1285
|
+
|
|
1286
|
+
| Type | Description |
|
|
1287
|
+
|------|-------------|
|
|
1288
|
+
| `Observable<T>`, `Observer<T>`, `Subscription` | Observable pattern |
|
|
1289
|
+
| `Subject<T>`, `BehaviorSubject<T>`, `ReplaySubject<T>` | Subject types |
|
|
1290
|
+
| `OperatorFunction<T, R>`, `MapOperator`, `FilterOperator` | Operators |
|
|
1291
|
+
| `DebounceOptions`, `ThrottleOptions`, `RetryOptions` | Operator options |
|
|
1292
|
+
| `Stream<T>`, `StreamValue<T>`, `StreamError` | Stream types |
|
|
1293
|
+
| `Signal<T>`, `WritableSignal<T>`, `Computed<T>` | Signal types |
|
|
1294
|
+
| `Effect`, `EffectCallback`, `SignalOptions<T>` | Effect types |
|
|
1295
|
+
| `Scheduler`, `SchedulerAction<T>`, `SchedulerLike` | Scheduler types |
|
|
1296
|
+
| `BackpressureStrategy`, `BackpressureConfig` | Backpressure |
|
|
1297
|
+
| `Flow<T>`, `FlowState`, `FlowController<T>` | Flow types |
|
|
1298
|
+
| `Channel<T>`, `BufferedChannel<T>`, `ChannelConfig<T>` | Channel types |
|
|
1299
|
+
| `CombineLatest<T>`, `Zip<T>`, `ForkJoinResult<T>` | Combinators |
|
|
1300
|
+
|
|
1041
1301
|
## Examples
|
|
1042
1302
|
|
|
1043
1303
|
```typescript
|