@stripe/extensibility-sdk 0.24.1 → 0.26.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 +328 -0
- package/dist/config-values/generate.cjs +1 -1
- package/dist/config-values/generate.d.ts +2 -0
- package/dist/config-values/generate.d.ts.map +1 -1
- package/dist/config-values/generate.js +1 -1
- package/dist/extensibility-sdk-alpha.d.ts +141 -98
- package/dist/extensibility-sdk-beta.d.ts +141 -98
- package/dist/extensibility-sdk-extensions-alpha.d.ts +155 -25
- package/dist/extensibility-sdk-extensions-beta.d.ts +155 -25
- package/dist/extensibility-sdk-extensions-internal.d.ts +160 -26
- package/dist/extensibility-sdk-extensions-public.d.ts +155 -25
- package/dist/extensibility-sdk-internal-alpha.d.ts +5 -0
- package/dist/extensibility-sdk-internal-beta.d.ts +5 -0
- package/dist/extensibility-sdk-internal-internal.d.ts +5 -0
- package/dist/extensibility-sdk-internal-public.d.ts +5 -0
- package/dist/extensibility-sdk-internal.d.ts +144 -82
- package/dist/extensibility-sdk-public.d.ts +141 -98
- package/dist/extensibility-sdk-stdlib-alpha.d.ts +146 -98
- package/dist/extensibility-sdk-stdlib-beta.d.ts +146 -98
- package/dist/extensibility-sdk-stdlib-internal.d.ts +149 -82
- package/dist/extensibility-sdk-stdlib-public.d.ts +146 -98
- package/dist/extensions/billing/bill/discount_calculation.d.ts +5 -3
- package/dist/extensions/billing/customer_balance_application.d.ts +3 -1
- package/dist/extensions/billing/invoice_collection_setting.d.ts +15 -11
- package/dist/extensions/billing/prorations.d.ts +30 -21
- package/dist/extensions/billing/recurring_billing_item_handling.d.ts +41 -23
- package/dist/extensions/billing/types.d.ts +4 -4
- package/dist/extensions/core/workflows/custom_action.d.ts +6 -2
- package/dist/extensions/extend/workflows/custom_action.d.ts +6 -2
- package/dist/index.cjs +398 -163
- package/dist/index.js +395 -158
- package/dist/internal.d.ts +4 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/stdlib/brand.d.ts +16 -10
- package/dist/stdlib/brand.d.ts.map +1 -1
- package/dist/stdlib/decimal.d.ts +50 -22
- package/dist/stdlib/decimal.d.ts.map +1 -1
- package/dist/stdlib/index.cjs +398 -163
- package/dist/stdlib/index.d.ts +11 -5
- package/dist/stdlib/index.d.ts.map +1 -1
- package/dist/stdlib/index.js +395 -158
- package/dist/stdlib/refs.d.ts +12 -20
- package/dist/stdlib/refs.d.ts.map +1 -1
- package/dist/stdlib/scalars.d.ts +51 -36
- package/dist/stdlib/scalars.d.ts.map +1 -1
- package/dist/stdlib/to-const.d.ts +35 -0
- package/dist/stdlib/to-const.d.ts.map +1 -0
- package/dist/stdlib/transforms.d.ts +1 -1
- package/dist/stdlib/type-utils.d.ts +3 -1
- package/dist/stdlib/types.d.ts +11 -11
- package/dist/stdlib/types.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/dist/api-surface.d.ts.map +0 -1
package/dist/stdlib/refs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type __brand, type __stripeType
|
|
1
|
+
import { type __brand, type __stripeType } from './brand.js';
|
|
2
2
|
import type { ExtractObjectTag } from './type-utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* Object reference — a typed pointer to another API resource.
|
|
@@ -20,29 +20,21 @@ export type Ref<T extends {
|
|
|
20
20
|
} = {
|
|
21
21
|
readonly object: string;
|
|
22
22
|
}> = {
|
|
23
|
-
|
|
23
|
+
/** The object tag of the referenced resource (e.g., "v2.core.customer"). */
|
|
24
24
|
type: ExtractObjectTag<T>;
|
|
25
|
+
/** The ID of the referenced resource. */
|
|
26
|
+
id: string;
|
|
25
27
|
} & {
|
|
26
|
-
readonly __type?: T;
|
|
27
28
|
readonly [__brand]: 'Ref';
|
|
29
|
+
readonly __type?: T;
|
|
28
30
|
readonly [__stripeType]: 'string';
|
|
29
31
|
};
|
|
30
32
|
/** Factory for creating {@link (Ref:type)} values from an object with `object` and `id` fields. @public */
|
|
31
|
-
export declare const Ref: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
readonly object: string;
|
|
39
|
-
} = {
|
|
40
|
-
readonly object: string;
|
|
41
|
-
}> = {
|
|
42
|
-
readonly __type?: T;
|
|
43
|
-
readonly [__brand]: 'PaginatedRefList';
|
|
44
|
-
readonly [__stripeType]: `list<${Ref<T>[StripeTypeSymbol]}>`;
|
|
45
|
-
} & Ref<T>[];
|
|
46
|
-
/** Factory for creating {@link PaginatedRefList} values from an array of {@link Ref} items. @public */
|
|
47
|
-
export declare const PaginatedRefList: { create: <T extends { readonly object: string } = { readonly object: string }>(items?: Ref<T>[]) => PaginatedRefList<T> };
|
|
33
|
+
export declare const Ref: {
|
|
34
|
+
create: <T extends {
|
|
35
|
+
readonly object: string;
|
|
36
|
+
}>(step: T & {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
}) => Ref<T>;
|
|
39
|
+
};
|
|
48
40
|
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/stdlib/refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/stdlib/refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,IAAI;IACrF,4EAA4E;IAC5E,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC1B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG;IACF,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC;CACnC,CAAC;AAEF,2GAA2G;AAC3G,eAAO,MAAM,GAAG;aACL,CAAC,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,QACtC,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAChC,GAAG,CAAC,CAAC,CAAC;CAOV,CAAC"}
|
package/dist/stdlib/scalars.d.ts
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import { type __integerBrand } from '@formspec/core';
|
|
2
2
|
import { type __brand, type __stripeType } from './brand.js';
|
|
3
|
+
import { Decimal } from './decimal.js';
|
|
3
4
|
/** A branded object type representing a JSON map (`map<string>`) in the Stripe type system. @public */
|
|
4
|
-
export type JsonObject = {
|
|
5
|
+
export type JsonObject = object & {
|
|
5
6
|
readonly [__brand]: 'JsonObject';
|
|
6
7
|
readonly [__stripeType]: 'map<string>';
|
|
7
|
-
}
|
|
8
|
+
};
|
|
8
9
|
/** Factory for creating {@link JsonObject} branded values. @public */
|
|
9
|
-
export declare const JsonObject: {
|
|
10
|
+
export declare const JsonObject: {
|
|
11
|
+
create: (value: object) => JsonObject;
|
|
12
|
+
};
|
|
10
13
|
/** A branded integer — a `number` guaranteed to satisfy `Number.isInteger`. @public */
|
|
11
|
-
export type Integer = {
|
|
14
|
+
export type Integer = number & {
|
|
12
15
|
readonly [__integerBrand]: true;
|
|
13
16
|
readonly [__stripeType]: 'int';
|
|
14
|
-
}
|
|
17
|
+
};
|
|
15
18
|
/**
|
|
16
|
-
* Distinct brand for PositiveInteger so an Integer is not assignable to
|
|
19
|
+
* Distinct brand key for PositiveInteger so an Integer is not assignable to
|
|
17
20
|
* PositiveInteger without going through the guard. PositiveInteger is a
|
|
18
21
|
* subtype of Integer (it carries both brands), so it can be used wherever
|
|
19
22
|
* Integer is expected.
|
|
20
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* String-literal const (not `unique symbol`) so that independent
|
|
25
|
+
* declaration rollups (root vs subpath) produce structurally compatible
|
|
26
|
+
* branded types.
|
|
27
|
+
*
|
|
28
|
+
* For internal use only — may be removed in a future release.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
21
31
|
*/
|
|
22
|
-
declare const __positiveIntegerBrand:
|
|
32
|
+
export declare const __positiveIntegerBrand: '__positiveIntegerBrand';
|
|
23
33
|
/**
|
|
24
34
|
* A branded non-negative integer — a `number` guaranteed to be an integer ≥ 0.
|
|
25
35
|
*
|
|
@@ -37,11 +47,11 @@ declare const __positiveIntegerBrand: unique symbol;
|
|
|
37
47
|
*
|
|
38
48
|
* @public
|
|
39
49
|
*/
|
|
40
|
-
export type PositiveInteger = {
|
|
50
|
+
export type PositiveInteger = number & {
|
|
41
51
|
readonly [__integerBrand]: true;
|
|
42
52
|
readonly [__positiveIntegerBrand]: true;
|
|
43
53
|
readonly [__stripeType]: 'int';
|
|
44
|
-
}
|
|
54
|
+
};
|
|
45
55
|
/**
|
|
46
56
|
* Rounding directions for coercing a number to an integer.
|
|
47
57
|
*
|
|
@@ -57,30 +67,35 @@ export type PositiveInteger = {
|
|
|
57
67
|
*
|
|
58
68
|
* @public
|
|
59
69
|
*/
|
|
60
|
-
export type IntegerRoundDirection = 'ceil' | 'floor' | '
|
|
61
|
-
/**
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
export
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
export type IntegerRoundDirection = 'ceil' | 'floor' | 'round-down' | 'round-up' | 'half-up';
|
|
71
|
+
/** @public */
|
|
72
|
+
export interface IntegerCompanion {
|
|
73
|
+
/** The Integer value `0`. @public */
|
|
74
|
+
readonly zero: Integer;
|
|
75
|
+
/** Type guard: narrows `unknown` to {@link (Integer:type)}. @public */
|
|
76
|
+
is(value: unknown): value is Integer;
|
|
77
|
+
/** Assertion guard: throws if not an {@link (Integer:type)}. @public */
|
|
78
|
+
assert(value: unknown): asserts value is Integer;
|
|
79
|
+
/** Coerce a value to {@link (Integer:type)} by rounding. @public */
|
|
80
|
+
from(value: string | number | Decimal | Integer, rounding: IntegerRoundDirection): Integer;
|
|
81
|
+
/** Lossless conversion to `Decimal`. @public */
|
|
82
|
+
toDecimal(value: Integer): Decimal;
|
|
83
|
+
/** Type guard: narrows {@link (Integer:type)} to {@link (PositiveInteger:type)}. @public */
|
|
84
|
+
isPositive(value: Integer): value is PositiveInteger;
|
|
85
|
+
/** Assertion guard: throws if the Integer is negative. @public */
|
|
86
|
+
assertIsPositive(value: Integer): asserts value is PositiveInteger;
|
|
87
|
+
}
|
|
88
|
+
/** Factory, type guard, and utilities for {@link (Integer:type)} branded values. @public */
|
|
89
|
+
export declare const Integer: IntegerCompanion;
|
|
90
|
+
/** @public */
|
|
91
|
+
export interface PositiveIntegerCompanion {
|
|
92
|
+
/** Type guard: narrows `unknown` to {@link (PositiveInteger:type)}. @public */
|
|
93
|
+
is(value: unknown): value is PositiveInteger;
|
|
94
|
+
/** Assertion guard: throws if not a {@link (PositiveInteger:type)}. @public */
|
|
95
|
+
assert(value: unknown): asserts value is PositiveInteger;
|
|
96
|
+
/** Coerce a value to {@link (PositiveInteger:type)} by rounding. Throws if negative. @public */
|
|
97
|
+
from(value: string | number | Decimal | Integer, rounding: IntegerRoundDirection): PositiveInteger;
|
|
98
|
+
}
|
|
99
|
+
/** Factory, type guard, and utilities for {@link (PositiveInteger:type)} branded values. @public */
|
|
100
|
+
export declare const PositiveInteger: PositiveIntegerCompanion;
|
|
86
101
|
//# sourceMappingURL=scalars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalars.d.ts","sourceRoot":"","sources":["../../src/stdlib/scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"scalars.d.ts","sourceRoot":"","sources":["../../src/stdlib/scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI7D,OAAO,EAAE,OAAO,EAAa,MAAM,cAAc,CAAC;AAElD,uGAAuG;AACvG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAChC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;CACxC,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,UAAU;oBACL,MAAM,KAAG,UAAU;CAIpC,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG;IAC7B,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;IAChC,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,wBAAwB,CAAC;A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CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,eAAe,CAAC;IACzD,gGAAgG;IAChG,IAAI,CACF,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,EAC1C,QAAQ,EAAE,qBAAqB,GAC9B,eAAe,CAAC;CACpB;AAED,oGAAoG;AACpG,eAAO,MAAM,eAAe,EAAE,wBAoE7B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively converts a type to a deeply-readonly version.
|
|
3
|
+
*
|
|
4
|
+
* Primitive types (`string`, `number`, `boolean`, `bigint`, `symbol`,
|
|
5
|
+
* `undefined`, `null`) are returned as-is. Arrays become `readonly` arrays
|
|
6
|
+
* of deeply-readonly elements. Object types have each property marked
|
|
7
|
+
* `readonly`, and the type of each property is recursively transformed.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export type DeepReadonly<T> = T extends string | number | boolean | bigint | symbol | undefined | null ? T : T extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : T extends object ? {
|
|
12
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
13
|
+
} : T;
|
|
14
|
+
/**
|
|
15
|
+
* Deep-freezes `value` and returns it typed as {@link DeepReadonly}`<T>`.
|
|
16
|
+
*
|
|
17
|
+
* Use this helper for module-scoped constant objects and arrays to satisfy
|
|
18
|
+
* the `dsl/no-module-scoped-mutable-const` lint rule. Unlike `Object.freeze`,
|
|
19
|
+
* which is shallow, `toConst` recursively freezes all nested objects and arrays.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { toConst } from '@stripe/extensibility-sdk/stdlib';
|
|
24
|
+
*
|
|
25
|
+
* const DEFAULTS = toConst({ timeout: 30, retries: 3 });
|
|
26
|
+
* // Type: { readonly timeout: 30; readonly retries: 3 }
|
|
27
|
+
*
|
|
28
|
+
* const STATUSES = toConst(['active', 'pending', 'cancelled']);
|
|
29
|
+
* // Type: readonly ["active", "pending", "cancelled"]
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export declare function toConst<T>(value: T): DeepReadonly<T>;
|
|
35
|
+
//# sourceMappingURL=to-const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-const.d.ts","sourceRoot":"","sources":["../../src/stdlib/to-const.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAC3B,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,GACT,IAAI,GACJ,CAAC,GACD,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAC/B,SAAS,YAAY,CAAC,IAAI,CAAC,EAAE,GAC7B,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC/C,CAAC,CAAC;AAEV;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAoBpD"}
|
|
@@ -31,7 +31,7 @@ export declare const _identity: _FieldTransformer;
|
|
|
31
31
|
/**
|
|
32
32
|
* Wraps a transformer so that a `null` / `undefined` result throws
|
|
33
33
|
* `WireParseError('Required field is missing')`, which `strategy.applyField`
|
|
34
|
-
* will catch and re-throw as
|
|
34
|
+
* will catch and re-throw as _WireReadError / _WireWriteError with field context.
|
|
35
35
|
*
|
|
36
36
|
* The inner transformer runs first, so strategies that backfill absent values
|
|
37
37
|
* (e.g. clock-aware `translateDateTime`) can satisfy the requirement.
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export type ExtractObjectTag<T> = T extends {
|
|
6
|
+
export type ExtractObjectTag<T> = T extends {
|
|
7
|
+
readonly object: infer O;
|
|
8
|
+
} ? O extends string ? O : never : never;
|
|
7
9
|
//# sourceMappingURL=type-utils.d.ts.map
|
package/dist/stdlib/types.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* Indicates malformed or unexpected data from the proto infrastructure —
|
|
8
8
|
* not a bug in the user's code.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class _WireReadError extends Error {
|
|
13
13
|
/**
|
|
14
14
|
* Error class name for `instanceof`-free identification.
|
|
15
15
|
* @internal
|
|
@@ -21,9 +21,9 @@ export declare class WireReadError extends Error {
|
|
|
21
21
|
* Indicates that the user's code returned a value that cannot be translated
|
|
22
22
|
* back to wire format.
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @internal
|
|
25
25
|
*/
|
|
26
|
-
export declare class
|
|
26
|
+
export declare class _WireWriteError extends Error {
|
|
27
27
|
/**
|
|
28
28
|
* Error class name for `instanceof`-free identification.
|
|
29
29
|
* @internal
|
|
@@ -33,7 +33,7 @@ export declare class WireWriteError extends Error {
|
|
|
33
33
|
/**
|
|
34
34
|
* Thrown by transformers when a wire value cannot be parsed.
|
|
35
35
|
* Caught by strategy.applyField, which enriches it with field context before
|
|
36
|
-
* re-throwing as
|
|
36
|
+
* re-throwing as _WireReadError or _WireWriteError.
|
|
37
37
|
*
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
@@ -52,12 +52,12 @@ export interface _EnumSpec {
|
|
|
52
52
|
* Convert a wire value to an SDK value, or `null` if unknown.
|
|
53
53
|
* @internal
|
|
54
54
|
*/
|
|
55
|
-
fromWire(value: string):
|
|
55
|
+
fromWire(value: string): string | null;
|
|
56
56
|
/**
|
|
57
57
|
* Convert an SDK value to a wire value, or `null` if unknown.
|
|
58
58
|
* @internal
|
|
59
59
|
*/
|
|
60
|
-
toWire(value: string):
|
|
60
|
+
toWire(value: string): string | null;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Bidirectional enum spec for proto-backed enums. Accepts a single
|
|
@@ -74,12 +74,12 @@ export declare class _ProtoEnum implements _EnumSpec {
|
|
|
74
74
|
* Convert a proto wire value to an SDK value, or `null` if unknown.
|
|
75
75
|
* @internal
|
|
76
76
|
*/
|
|
77
|
-
fromWire(value: string):
|
|
77
|
+
fromWire(value: string): string | null;
|
|
78
78
|
/**
|
|
79
79
|
* Convert an SDK value to a proto wire value, or `null` if unknown.
|
|
80
80
|
* @internal
|
|
81
81
|
*/
|
|
82
|
-
toWire(value: string):
|
|
82
|
+
toWire(value: string): string | null;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Validation-only enum spec for config values. Accepts a set of known
|
|
@@ -95,12 +95,12 @@ export declare class _ConfigEnum implements _EnumSpec {
|
|
|
95
95
|
* Validate and return the wire value unchanged, or `null` if unknown.
|
|
96
96
|
* @internal
|
|
97
97
|
*/
|
|
98
|
-
fromWire(value: string):
|
|
98
|
+
fromWire(value: string): string | null;
|
|
99
99
|
/**
|
|
100
100
|
* Validate and return the SDK value unchanged, or `null` if unknown.
|
|
101
101
|
* @internal
|
|
102
102
|
*/
|
|
103
|
-
toWire(value: string):
|
|
103
|
+
toWire(value: string): string | null;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* A field transformer with the strategy threaded through so transforms can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/stdlib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;GAMG;AACH,qBAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/stdlib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;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