capnpc-ts
Version:
Cap'n Proto schema compiler for TypeScript.
29 lines (28 loc) • 1.5 kB
TypeScript
import * as capnp from "capnp-ts";
import * as s from "capnp-ts/src/std/schema.capnp.js";
import { CodeGeneratorFileContext } from "./code-generator-file-context";
export declare function compareCodeOrder(a: {
getCodeOrder(): number;
}, b: {
getCodeOrder(): number;
}): number;
export declare function getConcreteListType(ctx: CodeGeneratorFileContext, type: s.Type): string;
export declare function getDisplayNamePrefix(node: s.Node): string;
export declare function getFullClassName(node: s.Node): string;
export declare function getJsType(ctx: CodeGeneratorFileContext, type: s.Type, constructor: boolean): string;
export declare function getUnnamedUnionFields(node: s.Node): s.Field[];
export declare function hasNode(ctx: CodeGeneratorFileContext, lookup: {
getId(): capnp.Uint64;
} | capnp.Uint64): boolean;
export declare function loadRequestedFile(req: s.CodeGeneratorRequest, file: s.CodeGeneratorRequest_RequestedFile): CodeGeneratorFileContext;
export declare function lookupNode(ctx: CodeGeneratorFileContext, lookup: {
getId(): capnp.Uint64;
} | capnp.Uint64): s.Node;
/**
* Determine whether the given field needs a concrete list class: this is currently the case for composite lists
* (`capnp.CompositeList`) and lists of lists (`capnp.PointerList`).
*
* @param {s.Field} field The field to check.
* @returns {boolean} Returns `true` if the field requires a concrete list class initializer.
*/
export declare function needsConcreteListClass(field: s.Field): boolean;