type-bridge-schema-codegen 2.1.0

Deterministic projection-only schema emitters for type-bridge
Documentation
/// Public names exported by the fixed TypeScript runtime resource.
pub(super) const PUBLIC_RUNTIME_NAMES: &[&str] = &[
    "Cardinality",
    "CompleteFacet",
    "FieldToken",
    "FunctionToken",
    "ModelToken",
    "ModelUse",
    "Multiplicity",
    "Aggregate",
    "AggregateOutputs",
    "BoundField",
    "BoundRole",
    "BoundVar",
    "Collected",
    "FirstOptions",
    "GroupedQuery",
    "Page",
    "PageOptions",
    "Predicate",
    "ProjectedManagerFilterValue",
    "ProjectedModelManager",
    "PlaysToken",
    "ProjectedModelForm",
    "ReferenceFacet",
    "RemoteQuery",
    "RemoteGroupedQuery",
    "RemoteQueryExchange",
    "RemoteQueryLimits",
    "RemoteQuerySession",
    "Query",
    "QueryModelToken",
    "QueryOrder",
    "QuerySession",
    "RoleToken",
    "RowsOptions",
    "Selection",
    "StructFactory",
    "StructValue",
    "TypeToken",
    "aggregate",
    "defineFieldToken",
    "defineFunctionToken",
    "defineModel",
    "definePlaysToken",
    "defineRoleToken",
    "defineStruct",
    "__installRuntimeProjectionPackage",
];

/// Fixed public schema/evidence names re-exported from the package root.
pub(super) const PUBLIC_SCHEMA_NAMES: &[&str] = &[
    "PLAYING_FACTS",
    "PROJECTION_FINGERPRINT",
    "PROJECTION_FINGERPRINT_JSON",
    "RUNTIME_PROJECTION_JSON",
    "SEMANTIC_SCHEMA_FINGERPRINT",
    "SEMANTIC_SCHEMA_FINGERPRINT_JSON",
];

/// Properties installed on generated model tokens or hydrated facets.
pub(super) const MODEL_RESERVED_NAMES: &[&str] = &[
    "__proto__",
    "completeRead",
    "constructor",
    "create",
    "declaration",
    "fields",
    "id",
    "iid",
    "metadata",
    "manager",
    "name",
    "plays",
    "prototype",
    "reference",
    "roles",
    "typeKey",
    "typeToken",
    "valueType",
];

/// Complete TypeScript-v1 strict-mode and contextual keyword set.
pub(super) const TYPESCRIPT_STRICT_KEYWORDS: &[&str] = &[
    "abstract",
    "any",
    "as",
    "asserts",
    "async",
    "await",
    "bigint",
    "boolean",
    "break",
    "case",
    "catch",
    "class",
    "const",
    "constructor",
    "continue",
    "debugger",
    "declare",
    "default",
    "delete",
    "do",
    "else",
    "enum",
    "export",
    "extends",
    "false",
    "finally",
    "for",
    "from",
    "function",
    "get",
    "if",
    "implements",
    "import",
    "in",
    "infer",
    "instanceof",
    "interface",
    "is",
    "keyof",
    "let",
    "module",
    "namespace",
    "never",
    "new",
    "null",
    "number",
    "object",
    "of",
    "out",
    "override",
    "package",
    "private",
    "protected",
    "public",
    "readonly",
    "require",
    "return",
    "satisfies",
    "set",
    "static",
    "string",
    "super",
    "switch",
    "symbol",
    "this",
    "throw",
    "true",
    "try",
    "type",
    "typeof",
    "undefined",
    "unique",
    "unknown",
    "using",
    "var",
    "void",
    "while",
    "with",
    "yield",
];

pub(super) fn is_typescript_keyword(value: &str) -> bool {
    TYPESCRIPT_STRICT_KEYWORDS.binary_search(&value).is_ok()
}