feat(serializer): add type inference for Order and update tsconfig for DOM support
This commit is contained in:
@@ -122,13 +122,15 @@ const Order = type('Order', {
|
|||||||
flags: flags(['ioc', 'post_only', 'reduce_only'] as const),
|
flags: flags(['ioc', 'post_only', 'reduce_only'] as const),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
type Order = typeof Order.$infer;
|
||||||
|
|
||||||
const marketOrder = {
|
const marketOrder = {
|
||||||
id: 1,
|
id: 1,
|
||||||
side: 'buy' as const,
|
side: 'buy' as const,
|
||||||
qty: 0.5,
|
qty: 0.5,
|
||||||
price: undefined,
|
price: undefined,
|
||||||
flags: { ioc: true, post_only: false, reduce_only: false },
|
flags: { ioc: true, post_only: false, reduce_only: false },
|
||||||
};
|
} satisfies Order;
|
||||||
|
|
||||||
const limitOrder = {
|
const limitOrder = {
|
||||||
id: 2,
|
id: 2,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext", "DOM"],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
@@ -14,7 +14,10 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"verbatimModuleSyntax": false
|
"verbatimModuleSyntax": false,
|
||||||
|
"paths": {
|
||||||
|
"@perf/serializer": ["./plugin/index.ts"],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": ["plugin/**/*.ts", "src/**/*.ts", "test/**/*.ts", "vite.config.ts"]
|
"include": ["plugin/**/*.ts", "src/**/*.ts", "test/**/*.ts", "vite.config.ts"],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user