import type { StandardSchemaV1 } from "@tsimpl/validation"; import type { Trait } from "@tsimpl/core"; import type { ReplaceSelf, ReplaceSelfInTuple } from "./replace-self.js"; type StaticDispatch = { [Key in keyof TTrait]: TTrait[Key] extends (self: infer SelfArg, ...args: infer Args) => infer Result ? (self: ReplaceSelf, ...args: ReplaceSelfInTuple) => ReplaceSelf : (self: ReplaceSelf) => ReplaceSelf; }; export type TraitDescriptor = { name: string; key: symbol; symbol: symbol; methods: readonly (keyof TTrait)[]; methodSet: ReadonlySet; defaults?: Readonly>; abstractMethods?: ReadonlySet; }; export type TraitToken = TraitDescriptor & StaticDispatch & { [Symbol.toPrimitive](): symbol; } & StandardSchemaV1 & symbol; export {};