refactor: rewrite playground

This commit is contained in:
2025-03-27 02:54:04 +08:00
parent 3c317627e7
commit 39e17eb6a5
19 changed files with 1161 additions and 1067 deletions

View File

@@ -342,10 +342,15 @@ function generateMkvSchemaHierarchy(elements_: EbmlElementType[]) {
const idMulti = new Set<string>();
const preDefs = [
'export const BinarySchema = type.instanceOf(Uint8Array);',
'export type BinaryType = typeof BinarySchema.infer;',
...Object.entries(AdHocType).map(
([name, meta]) =>
`export const ${meta.primitive()} = type.instanceOf(Ebml${name}Tag);`
),
...Object.entries(AdHocType).map(
([name, meta]) =>
`export type ${name}Type = typeof ${meta.primitive()}.infer;`
),
];
const generateAssociated = (el: EbmlElementType): string | undefined => {