Skip to content

Commit e3cc9d1

Browse files
authored
Export TypedString, JsonStringifyResult, Jsonify, JsonifyObject (#165)
1 parent 9f2fbd4 commit e3cc9d1

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

pkgs/typed-api-spec/src/index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ export {
2121
import FetchT, { RequestInitT } from "./fetch";
2222
export { FetchT, RequestInitT };
2323

24-
import JSONT, { JSON$stringifyT } from "./json";
25-
export { JSONT, JSON$stringifyT };
24+
import JSONT, {
25+
JSON$stringifyT,
26+
TypedString,
27+
JsonStringifyResult,
28+
Jsonify,
29+
JsonifyObject,
30+
} from "./json";
31+
export {
32+
JSONT,
33+
JSON$stringifyT,
34+
TypedString,
35+
JsonStringifyResult,
36+
Jsonify,
37+
JsonifyObject,
38+
};
2639

2740
export {
2841
newHttp as newMswHttp,

pkgs/typed-api-spec/src/json/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type JsonPrimitive = string | number | boolean | null | Date;
2020
// eslint-disable-next-line @typescript-eslint/ban-types
2121
type InvalidJsonValue = undefined | Function | symbol | bigint;
2222

23-
type JsonifyObject<T> = {
23+
export type JsonifyObject<T> = {
2424
[K in keyof T as K extends string
2525
? T[K] extends InvalidJsonValue
2626
? never
@@ -39,7 +39,7 @@ type JsonifyTuple<T extends readonly unknown[]> = T extends [
3939
]
4040
: [];
4141

42-
type Jsonify<T> = T extends { toJSON(): infer R }
42+
export type Jsonify<T> = T extends { toJSON(): infer R }
4343
? Jsonify<R>
4444
: T extends Date
4545
? string

0 commit comments

Comments
 (0)