import type { AnyCaller } from "./function.js"; import type { Nullish } from "./null.js"; /** Entity strings combine a type and ID, e.g. `challenge:a1b2c3` */ export type Entity = `${T}:${string}`; /** Extract the type from an `Entity` string. */ export type EntityType = E extends Entity ? T : never; /** Empty entity has undefined type and ID. */ export type EmptyEntity = [type: undefined, id: undefined]; /** Empty entity. */ export declare const EMPTY_ENTITY: EmptyEntity; /** Split an optional entity tag like `challenge:a1b2c3` into `["challenge", "a1b2c3"]`, or return `EmptyEntity` if the entity was invalid. */ export declare function getEntity(entity: Entity): [type: T, id: string]; export declare function getEntity(entity: Nullish>): [type: T, id: string] | EmptyEntity; export declare function getEntity(entity: Nullish): [type: string, id: string] | EmptyEntity; /** Split an entity tag like `challenge:a1b2c3` into `type` and `id`, or throw `RequiredError` if the entity tag was invalid. */ export declare function requireEntity(entity: Entity, caller?: AnyCaller): [type: T, id: string]; export declare function requireEntity(entity: string, caller?: AnyCaller): [type: string, id: string];