0.1.6Updated a month ago
declare namespace Entity {
  interface Entity<
    EventMap extends Record<string, any[]>,
    EntityName extends string = "",
    PermissionMap extends readonly string[] = [],
    EMC extends Entity.Meta.Config = any,
    PEMC extends Entity.Meta.Config = any,
  > {
    /**
     * Formats a key based on the formatting rules of the supply.
     * 
     * @param {string} key - The unique value referring to a user. Usually their `msisdn`
     */
    format_key(key: string): string

    /**
     * Validates a key based on the validation rules of the supply.
     * 
     * @param {string} key - The unique value referring to a user. Usually their `msisdn`
     */
    validate_key(key: string): KeyValidation

    /**
     * Used to set up the supply at the start of the application.
     * 
     * - Creates databases and indexes
     * - Creates SQL helper functions
     */
    Setup(): Promise<Entity.Entity<EventMap, EntityName>>

    name: string

    slug: string
    slug_plural: string

    permissions: Entity.Permissions.Map<PermissionMap, PermissionMap[number]>

    REST: import("@infinity-beyond/classes/rest_wrapper.ts").REST_Wrapper

    meta: import("@infinity-beyond/classes/data_types/entity/entity.meta.ts").EntityMeta<EMC, PEMC>
  }
}