@stryke/capnp
Version:
A package to assist in running the Cap'n Proto compiler and creating Cap'n Proto serialization protocol schemas.
1 lines • 2.82 kB
Source Map (JSON)
{"version":3,"file":"types.mjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable camelcase */\n\nimport type {\n CodeGeneratorRequest_RequestedFile_Import,\n Field,\n Node\n} from \"capnp-es/capnp/schema\";\n// eslint-disable-next-line ts/consistent-type-imports\nimport { ParsedCommandLine } from \"typescript\";\n\nexport interface CodeGeneratorFileContext {\n // inputs\n readonly nodes: Node[];\n readonly imports: CodeGeneratorRequest_RequestedFile_Import[];\n\n // outputs\n concreteLists: Array<[string, Field]>;\n generatedNodeIds: Set<string>;\n generatedResultsPromiseIds: Set<bigint>;\n tsPath: string;\n codeParts?: string[];\n\n constructor: any;\n\n toString: () => string;\n}\n\nexport class CodeGeneratorContext {\n files: CodeGeneratorFileContext[] = [];\n}\n\nexport interface CapnpcCLIOptions {\n noTs?: boolean;\n js?: boolean;\n dts?: boolean;\n noDts?: boolean;\n schema?: string;\n output?: string;\n importPath?: string;\n tsconfig?: string;\n skipGenerateId?: boolean;\n noStandardImport?: boolean;\n projectRoot?: string;\n workspaceRoot?: string;\n tty?: boolean;\n}\n\nexport type CapnpcOptions = Omit<CapnpcCLIOptions, \"tsconfig\" | \"schema\"> & {\n schemas: string | string[];\n} & (\n | {\n tsconfig: ParsedCommandLine;\n tsconfigPath?: string;\n }\n | {\n tsconfig?: ParsedCommandLine;\n tsconfigPath: string;\n }\n );\n\nexport type CapnpcResolvedOptions = Omit<\n CapnpcOptions,\n | \"noTs\"\n | \"noDts\"\n | \"schemas\"\n | \"tsconfigPath\"\n | \"output\"\n | \"importPath\"\n | \"projectRoot\"\n | \"workspaceRoot\"\n> &\n Required<Pick<CapnpcOptions, \"output\" | \"projectRoot\" | \"workspaceRoot\">> & {\n ts: boolean;\n importPath: string[];\n schemas: string[];\n tsconfig: ParsedCommandLine;\n };\n\nexport interface CapnpcResult {\n ctx: CodeGeneratorContext;\n files: Map<string, string>;\n}\n"],"mappings":";AA6CA,IAAa,uBAAb,MAAkC;CAChC,QAAoC,EAAE"}