@nxtedition/types 23.1.4 → 23.1.6

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.
@@ -1,5 +1,7 @@
1
1
  /// <reference lib="esnext.asynciterable" />
2
2
 
3
+ import { TagBase } from './TagBase';
4
+
3
5
  /**
4
6
  All diff* functions should return a list of operations, often empty.
5
7
 
@@ -817,6 +819,8 @@ declare interface EventDomainRecords {
817
819
  ":event.children?": EventChildrenRecord;
818
820
  ":event.props?": EventPropsRecord;
819
821
  ":event.stats?": EventStatsRecord;
822
+ ":event.readDuration?": EventReadDurationRecord;
823
+ ":event.readRate?": EventReadRateRecord;
820
824
  }
821
825
 
822
826
  declare interface EventDurationRecord {
@@ -850,6 +854,19 @@ declare type EventProps = {
850
854
 
851
855
  declare type EventPropsRecord = EventProps & Record<Exclude<string, keyof EventProps>, JsonValue>;
852
856
 
857
+ declare interface EventReadDurationRecord {
858
+ numChars?: number;
859
+ numWords?: number;
860
+ readRate?: number;
861
+ readDuration?: number;
862
+ readType?: ReadType;
863
+ }
864
+
865
+ declare interface EventReadRateRecord {
866
+ readRate?: number;
867
+ readType?: ReadType;
868
+ }
869
+
853
870
  declare interface EventRecord {
854
871
  start?: number | null;
855
872
  end?: number | null;
@@ -1721,24 +1738,29 @@ declare interface ListNodeContent {
1721
1738
  }
1722
1739
 
1723
1740
  /**
1724
- * Maximum value constraint tag.
1725
- *
1726
- * Enforces that a numeric value must be less than or equal to the specified
1727
- * maximum. This constraint validates that the input value satisfies: input <=
1728
- * maximum.
1741
+ * Inclusive maximum value constraint (value <= max).
1729
1742
  *
1730
- * Example usage:
1743
+ * `Maximum<N>` is a type tag that validates numeric values are less than or
1744
+ * equal to the specified bound. Apply it to `number` or `bigint` properties
1745
+ * using TypeScript intersection types.
1731
1746
  *
1732
- * ```typescript
1733
- * type Percentage = number & tags.Maximum<100>; // Must be <= 100
1734
- * type SmallInt = bigint & tags.Maximum<255n>; // BigInt must be <= 255
1735
- * ```
1747
+ * This constraint is **mutually exclusive** with {@link ExclusiveMaximum} - you
1748
+ * cannot use both on the same property. Use `Maximum` for inclusive bounds (<=)
1749
+ * and `ExclusiveMaximum` for exclusive bounds (<).
1736
1750
  *
1737
- * Note: This tag is mutually exclusive with ExclusiveMaximum. You cannot apply
1738
- * both Maximum and ExclusiveMaximum constraints to the same property.
1751
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
1752
+ * `typia.validate()`. It also generates `maximum` in JSON Schema output.
1739
1753
  *
1740
1754
  * @author Jeongho Nam - https://github.com/samchon
1741
- * @template Value - The maximum value constraint (number or bigint literal)
1755
+ * @example
1756
+ * interface Rating {
1757
+ * // Score from 0-100
1758
+ * score: number & Minimum<0> & Maximum<100>;
1759
+ * // Percentage cannot exceed 1.0
1760
+ * ratio: number & Maximum<1.0>;
1761
+ * }
1762
+ *
1763
+ * @template Value The maximum allowed value (inclusive)
1742
1764
  */
1743
1765
  declare type Maximum<Value extends number | bigint> = TagBase<{
1744
1766
  target: Value extends bigint ? "bigint" : "number";
@@ -1900,24 +1922,29 @@ declare interface Message {
1900
1922
  declare type MethodsRecord = Union["methods"];
1901
1923
 
1902
1924
  /**
1903
- * Minimum value constraint tag.
1904
- *
1905
- * Enforces that a numeric value must be greater than or equal to the specified
1906
- * minimum. This constraint validates that the input value satisfies: input >=
1907
- * minimum.
1925
+ * Inclusive minimum value constraint (value >= min).
1908
1926
  *
1909
- * Example usage:
1927
+ * `Minimum<N>` is a type tag that validates numeric values are greater than or
1928
+ * equal to the specified bound. Apply it to `number` or `bigint` properties
1929
+ * using TypeScript intersection types.
1910
1930
  *
1911
- * ```typescript
1912
- * type Age = number & tags.Minimum<0>; // Age must be 0 or greater
1913
- * type Balance = bigint & tags.Minimum<0n>; // BigInt balance must be non-negative
1914
- * ```
1931
+ * This constraint is **mutually exclusive** with {@link ExclusiveMinimum} - you
1932
+ * cannot use both on the same property. Use `Minimum` for inclusive bounds (>=)
1933
+ * and `ExclusiveMinimum` for exclusive bounds (>).
1915
1934
  *
1916
- * Note: This tag is mutually exclusive with ExclusiveMinimum. You cannot apply
1917
- * both Minimum and ExclusiveMinimum constraints to the same property.
1935
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
1936
+ * `typia.validate()`. It also generates `minimum` in JSON Schema output.
1918
1937
  *
1919
1938
  * @author Jeongho Nam - https://github.com/samchon
1920
- * @template Value - The minimum value constraint (number or bigint literal)
1939
+ * @example
1940
+ * interface Product {
1941
+ * // Price must be 0 or greater
1942
+ * price: number & Minimum<0>;
1943
+ * // Quantity must be at least 1
1944
+ * quantity: number & Minimum<1>;
1945
+ * }
1946
+ *
1947
+ * @template Value The minimum allowed value (inclusive)
1921
1948
  */
1922
1949
  declare type Minimum<Value extends number | bigint> = TagBase<{
1923
1950
  target: Value extends bigint ? "bigint" : "number";
@@ -2223,8 +2250,6 @@ declare interface NxtStatusService extends NxtStatusObject {
2223
2250
  /**
2224
2251
  * A representation of any set of values over any amount of time. This is the most basic building block
2225
2252
  * of RxJS.
2226
- *
2227
- * @class Observable<T>
2228
2253
  */
2229
2254
  declare class Observable<T> implements Subscribable<T> {
2230
2255
  /**
@@ -2236,8 +2261,7 @@ declare class Observable<T> implements Subscribable<T> {
2236
2261
  */
2237
2262
  operator: Operator<any, T> | undefined;
2238
2263
  /**
2239
- * @constructor
2240
- * @param {Function} subscribe the function that is called when the Observable is
2264
+ * @param subscribe The function that is called when the Observable is
2241
2265
  * initially subscribed to. This function is given a Subscriber, to which new values
2242
2266
  * can be `next`ed, or an `error` method can be called to raise an error, or
2243
2267
  * `complete` can be called to notify of a successful completion.
@@ -2245,20 +2269,16 @@ declare class Observable<T> implements Subscribable<T> {
2245
2269
  constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
2246
2270
  /**
2247
2271
  * Creates a new Observable by calling the Observable constructor
2248
- * @owner Observable
2249
- * @method create
2250
- * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
2251
- * @return {Observable} a new observable
2252
- * @nocollapse
2272
+ * @param subscribe the subscriber function to be passed to the Observable constructor
2273
+ * @return A new observable.
2253
2274
  * @deprecated Use `new Observable()` instead. Will be removed in v8.
2254
2275
  */
2255
2276
  static create: (...args: any[]) => any;
2256
2277
  /**
2257
2278
  * Creates a new Observable, with this Observable instance as the source, and the passed
2258
2279
  * operator defined as the new observable's operator.
2259
- * @method lift
2260
2280
  * @param operator the operator defining the operation to take on the observable
2261
- * @return a new observable with the Operator applied
2281
+ * @return A new observable with the Operator applied.
2262
2282
  * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
2263
2283
  * If you have implemented an operator using `lift`, it is recommended that you create an
2264
2284
  * operator by simply returning `new Observable()` directly. See "Creating new operators from
@@ -2308,9 +2328,9 @@ declare class Observable<T> implements Subscribable<T> {
2308
2328
  * // 'Total: 6'
2309
2329
  * ```
2310
2330
  *
2311
- * @param next a handler for each value emitted by the observable
2312
- * @return a promise that either resolves on observable completion or
2313
- * rejects with the handled error
2331
+ * @param next A handler for each value emitted by the observable.
2332
+ * @return A promise that either resolves on observable completion or
2333
+ * rejects with the handled error.
2314
2334
  */
2315
2335
  forEach(next: (value: T) => void): Promise<void>;
2316
2336
  /**
@@ -2431,22 +2451,33 @@ declare interface ParagraphNodeContent extends ElementNodeContent {
2431
2451
  declare type Paths<Data> = keyof Data & string;
2432
2452
 
2433
2453
  /**
2434
- * String pattern (regular expression) constraint tag.
2454
+ * Regular expression pattern constraint for strings.
2435
2455
  *
2436
- * Validates that a string matches a specified regular expression pattern. Use
2437
- * this tag to enforce custom string formats through regex validation.
2456
+ * `Pattern<Regex>` is a type tag that validates string values match the
2457
+ * specified regular expression pattern. Apply it to `string` properties using
2458
+ * TypeScript intersection types.
2438
2459
  *
2439
- * Examples:
2460
+ * This constraint is **mutually exclusive** with {@link Format} - you cannot use
2461
+ * both on the same property. Use `Pattern` for custom regex validation, or
2462
+ * `Format` for standard formats (email, uuid, etc.).
2440
2463
  *
2441
- * ```ts
2442
- * type PhoneNumber = string & Pattern<"^\d{3}-\d{3}-\d{4}$">; // 123-456-7890
2443
- * type HexColor = string & Pattern<"^#[0-9A-Fa-f]{6}$">; // #FF5733
2444
- * ```
2464
+ * The pattern should be a valid JavaScript regular expression string without
2465
+ * the surrounding slashes. The entire string must match (implicit `^` and `$`
2466
+ * anchors).
2445
2467
  *
2446
- * Note: This tag is mutually exclusive with the Format tag. You cannot use both
2447
- * Pattern and Format on the same type.
2468
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
2469
+ * `typia.validate()`. It generates `pattern` in JSON Schema output.
2448
2470
  *
2449
2471
  * @author Jeongho Nam - https://github.com/samchon
2472
+ * @example
2473
+ * interface Product {
2474
+ * // SKU format: 3 letters, dash, 4 digits
2475
+ * sku: string & Pattern<"^[A-Z]{3}-[0-9]{4}$">;
2476
+ * // Phone number: digits and optional dashes
2477
+ * phone: string & Pattern<"^[0-9-]+$">;
2478
+ * }
2479
+ *
2480
+ * @template Value Regular expression pattern as a string literal
2450
2481
  */
2451
2482
  declare type Pattern<Value extends string> = TagBase<{
2452
2483
  target: "string";
@@ -2680,6 +2711,8 @@ number,
2680
2711
  number
2681
2712
  ];
2682
2713
 
2714
+ declare type ReadType = "characters" | "words" | "wordsPerMinute";
2715
+
2683
2716
  declare interface Records extends KeyedDomainRecords, KeyedProvidedDomainRecords, DbExactRecords, DbProvidedRecord {
2684
2717
  [key: string]: unknown;
2685
2718
  }
@@ -2949,6 +2982,11 @@ declare interface RenderSceneFilters {
2949
2982
  };
2950
2983
  }
2951
2984
 
2985
+ declare interface RenderSceneFocus {
2986
+ x?: number;
2987
+ y?: number;
2988
+ }
2989
+
2952
2990
  declare type RenderSceneInterlaced = false | "tff" | "bff";
2953
2991
 
2954
2992
  declare interface RenderSceneObject {
@@ -2973,6 +3011,7 @@ declare interface RenderSceneObject {
2973
3011
  video?: {
2974
3012
  filters?: RenderSceneFilters;
2975
3013
  crop?: RenderSceneCrop;
3014
+ focus?: RenderSceneFocus;
2976
3015
  orientation?: number;
2977
3016
  /** @deprecated Use input.video.interlaced */
2978
3017
  interlaced?: RenderSceneInterlaced | null;
@@ -3267,6 +3306,10 @@ declare type SerializedLexicalNode = {
3267
3306
  type: string;
3268
3307
  /** A numeric version for this schema, defaulting to 1, but not generally recommended for use */
3269
3308
  version: number;
3309
+ /**
3310
+ * Any state persisted with the NodeState API that is not
3311
+ * configured for flat storage
3312
+ */
3270
3313
  [NODE_STATE_KEY]?: Record<string, unknown>;
3271
3314
  };
3272
3315
 
@@ -4064,8 +4107,6 @@ declare interface Subscribable<T> {
4064
4107
  * a Subscriber, in order to provide Subscription-like capabilities such as
4065
4108
  * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
4066
4109
  * implementing operators, but it is rarely used as a public API.
4067
- *
4068
- * @class Subscriber<T>
4069
4110
  */
4070
4111
  declare class Subscriber<T> extends Subscription implements Observer<T> {
4071
4112
  /**
@@ -4078,7 +4119,6 @@ declare class Subscriber<T> extends Subscription implements Observer<T> {
4078
4119
  * Observer.
4079
4120
  * @return A Subscriber wrapping the (partially defined)
4080
4121
  * Observer represented by the given arguments.
4081
- * @nocollapse
4082
4122
  * @deprecated Do not use. Will be removed in v8. There is no replacement for this
4083
4123
  * method, and there is no reason to be creating instances of `Subscriber` directly.
4084
4124
  * If you have a specific use case, please file an issue.
@@ -4097,23 +4137,20 @@ declare class Subscriber<T> extends Subscription implements Observer<T> {
4097
4137
  * The {@link Observer} callback to receive notifications of type `next` from
4098
4138
  * the Observable, with a value. The Observable may call this method 0 or more
4099
4139
  * times.
4100
- * @param {T} [value] The `next` value.
4101
- * @return {void}
4140
+ * @param value The `next` value.
4102
4141
  */
4103
- next(value?: T): void;
4142
+ next(value: T): void;
4104
4143
  /**
4105
4144
  * The {@link Observer} callback to receive notifications of type `error` from
4106
4145
  * the Observable, with an attached `Error`. Notifies the Observer that
4107
4146
  * the Observable has experienced an error condition.
4108
- * @param {any} [err] The `error` exception.
4109
- * @return {void}
4147
+ * @param err The `error` exception.
4110
4148
  */
4111
4149
  error(err?: any): void;
4112
4150
  /**
4113
4151
  * The {@link Observer} callback to receive a valueless notification of type
4114
4152
  * `complete` from the Observable. Notifies the Observer that the Observable
4115
4153
  * has finished sending push-based notifications.
4116
- * @return {void}
4117
4154
  */
4118
4155
  complete(): void;
4119
4156
  unsubscribe(): void;
@@ -4131,12 +4168,9 @@ declare class Subscriber<T> extends Subscription implements Observer<T> {
4131
4168
  * method, which will attach a child Subscription to the current Subscription.
4132
4169
  * When a Subscription is unsubscribed, all its children (and its grandchildren)
4133
4170
  * will be unsubscribed as well.
4134
- *
4135
- * @class Subscription
4136
4171
  */
4137
4172
  declare class Subscription implements SubscriptionLike {
4138
4173
  private initialTeardown?;
4139
- /** @nocollapse */
4140
4174
  static EMPTY: Subscription;
4141
4175
  /**
4142
4176
  * A flag to indicate whether this Subscription has already been unsubscribed.
@@ -4157,7 +4191,6 @@ declare class Subscription implements SubscriptionLike {
4157
4191
  * Disposes the resources held by the subscription. May, for instance, cancel
4158
4192
  * an ongoing Observable execution or cancel any other type of work that
4159
4193
  * started when the Subscription was created.
4160
- * @return {void}
4161
4194
  */
4162
4195
  unsubscribe(): void;
4163
4196
  /**
@@ -4325,88 +4358,6 @@ declare interface SubtitleStyleDomainRecords {
4325
4358
  ":subtitle-style": SubtitleStyleDomainRecord;
4326
4359
  }
4327
4360
 
4328
- /**
4329
- * Base type for all validation tags in typia.
4330
- *
4331
- * TagBase provides the foundation for all typia's validation tags. It attaches
4332
- * metadata to TypeScript types that typia's transformer processes at
4333
- * compile-time to generate optimized runtime validation code.
4334
- *
4335
- * @author Jeongho Nam - https://github.com/samchon
4336
- * @example
4337
- * ```typescript
4338
- * // Custom tag example
4339
- * type MyCustomTag<Value extends number> = TagBase<{
4340
- * target: "number";
4341
- * kind: "MyCustom";
4342
- * value: Value;
4343
- * validate: `$input === ${Value}`;
4344
- * }>;
4345
- * ```
4346
- *
4347
- * @template Props - Tag properties that define validation behavior
4348
- */
4349
- declare type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>> = {
4350
- /**
4351
- * This is a dummy property for compilation.
4352
- *
4353
- * It does not mean anything in runtime.
4354
- */
4355
- "typia.tag"?: Props;
4356
- };
4357
-
4358
- declare namespace TagBase {
4359
- /**
4360
- * Properties interface for validation tags.
4361
- *
4362
- * @author Jeongho Nam - https://github.com/samchon
4363
- */
4364
- interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | {
4365
- [key in Target]?: string;
4366
- }, Exclusive extends boolean | string[], Schema extends object | undefined> {
4367
- /**
4368
- * Target type.
4369
- *
4370
- * If user tries to adapt this tag to a different type, it would be a
4371
- * compile error.
4372
- *
4373
- * For example, you've configured target type as `string`, but user adapted
4374
- * it onto a `number` type (`number & YourCustomTag<Value>`), then it would
4375
- * be blocked by TypeScript compiler.
4376
- */
4377
- target: Target;
4378
- /** What kind of tag is this? */
4379
- kind: Kind;
4380
- /** Value to be configured by user. */
4381
- value: Value;
4382
- /**
4383
- * Validation script.
4384
- *
4385
- * This script would be inserted into the generated validation function. In
4386
- * here script, target variable name must be `$input`. The variable name
4387
- * `$input` would be transformed to the suitable when compilation.
4388
- *
4389
- * Also, If you've take a mistake on this script, compile error would be
4390
- * occurred. So, define it with confidence. Compiler will block all your
4391
- * mistakes.
4392
- */
4393
- validate?: Validate;
4394
- /**
4395
- * Exclusive option.
4396
- *
4397
- * If this property configured as `true`, same {@link kind} tag cannot be
4398
- * duplicated in the target type. Otherwise, if you've configured this
4399
- * property as string array, all of the {@link kind} value assigned tags
4400
- * cannot be compatible in the target type.
4401
- *
4402
- * @default false
4403
- */
4404
- exclusive?: Exclusive | string[];
4405
- /** Additional schema info assigned to the {@link IJsonSchema} object. */
4406
- schema?: Schema;
4407
- }
4408
- }
4409
-
4410
4361
  declare interface TagPermission {
4411
4362
  type: "tag";
4412
4363
  method?: undefined;
@@ -4505,31 +4456,37 @@ declare interface TranscribeReplaceReplacer {
4505
4456
  }
4506
4457
 
4507
4458
  /**
4508
- * Type tag for specifying numeric bit-width representations.
4459
+ * Numeric precision and bit-width type constraint.
4460
+ *
4461
+ * `Type<Value>` is a type tag that constrains numeric values to specific
4462
+ * bit-width representations. This is essential for Protocol Buffers
4463
+ * serialization and ensures values fit within their specified ranges.
4509
4464
  *
4510
- * Constrains numeric types to specific bit-width formats used in systems
4511
- * programming and protocol buffers. Ensures numbers conform to
4512
- * platform-specific representations.
4465
+ * Available types:
4513
4466
  *
4514
- * Supported types:
4467
+ * - `"int32"`: Signed 32-bit integer (-2,147,483,648 to 2,147,483,647)
4468
+ * - `"uint32"`: Unsigned 32-bit integer (0 to 4,294,967,295)
4469
+ * - `"int64"`: Signed 64-bit integer (for `number` or `bigint`)
4470
+ * - `"uint64"`: Unsigned 64-bit integer (for `number` or `bigint`)
4471
+ * - `"float"`: 32-bit floating point
4472
+ * - `"double"`: 64-bit floating point (default JavaScript number)
4515
4473
  *
4516
- * - `int32`: 32-bit signed integer (-2^31 to 2^31-1)
4517
- * - `uint32`: 32-bit unsigned integer (0 to 2^32-1)
4518
- * - `int64`: 64-bit signed integer (supports both bigint and number)
4519
- * - `uint64`: 64-bit unsigned integer (supports both bigint and number)
4520
- * - `float`: 32-bit floating point (single precision)
4521
- * - `double`: 64-bit floating point (double precision, default JS number)
4474
+ * For Protocol Buffers, integer types also determine the wire encoding. The
4475
+ * constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
4476
+ * `typia.validate()`. It generates appropriate `type` in JSON Schema.
4522
4477
  *
4523
4478
  * @author Jeongho Nam - https://github.com/samchon
4524
4479
  * @example
4525
- * ```typescript
4526
- * type Score = number & Type<"int32">; // -2,147,483,648 to 2,147,483,647
4527
- * type UserId = number & Type<"uint32">; // 0 to 4,294,967,295
4528
- * type FileSize = bigint & Type<"int64">; // Large file sizes
4529
- * type Coordinate = number & Type<"double">; // High precision coordinates
4530
- * ```
4480
+ * interface Message {
4481
+ * // 32-bit unsigned integer
4482
+ * id: number & Type<"uint32">;
4483
+ * // 64-bit signed integer as bigint
4484
+ * timestamp: bigint & Type<"int64">;
4485
+ * // 32-bit float for memory efficiency
4486
+ * score: number & Type<"float">;
4487
+ * }
4531
4488
  *
4532
- * @template Value - The numeric type representation
4489
+ * @template Value Numeric type identifier
4533
4490
  */
4534
4491
  declare type Type<Value extends "int32" | "uint32" | "int64" | "uint64" | "float" | "double"> = TagBase<{
4535
4492
  target: Value extends "int64" | "uint64" ? "bigint" | "number" : "number";
@@ -11,6 +11,8 @@ export interface EventDomainRecords {
11
11
  ":event.children?": EventChildrenRecord;
12
12
  ":event.props?": EventPropsRecord;
13
13
  ":event.stats?": EventStatsRecord;
14
+ ":event.readDuration?": EventReadDurationRecord;
15
+ ":event.readRate?": EventReadRateRecord;
14
16
  }
15
17
  export interface EventRecord {
16
18
  start?: number | null;
@@ -56,6 +58,17 @@ export interface EventOverlayRecord {
56
58
  data: EventPropsRecord;
57
59
  };
58
60
  }
61
+ export interface EventReadDurationRecord {
62
+ numChars?: number;
63
+ numWords?: number;
64
+ readRate?: number;
65
+ readDuration?: number;
66
+ readType?: ReadType;
67
+ }
68
+ export interface EventReadRateRecord {
69
+ readRate?: number;
70
+ readType?: ReadType;
71
+ }
59
72
  export interface SubtitleEventStyleOverrides {
60
73
  marginL?: string;
61
74
  marginR?: string;
@@ -72,4 +85,5 @@ export interface SubtitleEventStyleOverrides {
72
85
  underline?: string;
73
86
  strikeOut?: string;
74
87
  }
88
+ export type ReadType = "characters" | "words" | "wordsPerMinute";
75
89
  export {};