import type { Brand } from "../util/brand"; // Literal // type StringValue = Brand; type BigIntRepresentation = Brand; export type Literal = | SimpleLiteral | BigIntLiteral | RegExpLiteral; export type SimpleLiteral = | NullLiteral | BooleanLiteral | NumberLiteral | StringLiteral; export type BooleanLiteral = TrueLiteral | FalseLiteral; // Specifier // export type SpecifierValue = Brand; export type SpecifierLiteral = StringLiteral; // Source // export type SourceValue = Brand; export type SourceLiteral = StringLiteral; // PublicKey // export type PublicKeyValue = Brand; export type PublicKeyLiteral = | NumberLiteral | StringLiteral | BigIntLiteral; // NullLiteral // export type NullLiteral = X & { type: "Literal"; value: null; raw: null | "null"; bigint: null; regex: null; }; // BooleanLiteran // export type TrueLiteral = X & { type: "Literal"; value: true; raw: null | "true"; bigint: null; regex: null; }; export type FalseLiteral = X & { type: "Literal"; value: false; raw: null | "false"; bigint: null; regex: null; }; // StringLiteral // export type StringRawValue = Brand; export type StringLiteral = X & { type: "Literal"; value: V; raw: null | StringRawValue; bigint: null; regex: null; }; // NumberLiteral // export type NumberRawValue = Brand; export type NumberLiteral = X & { type: "Literal"; value: number; raw: null | NumberRawValue; bigint: null; regex: null; }; // BigIntLiteral // export type BigIntRawValue = Brand; export type BigIntLiteral = X & { type: "Literal"; value: null; raw: null | BigIntRawValue; bigint: B; regex: null; }; // RegExpLiteral // export type RegExpRawValue = Brand; export type RegExpPattern = Brand; export type RegExpFlagList = Brand; // export type RegExpFlag = "d" | "g" | "i" | "m" | "s" | "u" | "v" | "y"; // // Type alias 'RegExpFlagList' circularly references itself.ts(2456) // export type RegExpFlagList = `${RegExpFlag}${RegExpFlagList}`; export type RegExpLiteral = X & { type: "Literal"; value: null; raw: null | RegExpRawValue; bigint: null; regex: { pattern: RegExpPattern; flags: RegExpFlagList; }; };