Module utils

Source

Type Aliases§

Source§

type Context = ReturnType<typeof bindContext>

Variables§

Source§

const $console: DecoratedInstance = ...

Source§

const CONTEXT_BINDINGS: {
    bundleTextures: (
        ctx: ContextWithoutFunctions,
        sources: string | string[],
    ) => string;
    copyFile: (ctx: ContextWithoutFunctions, src: string, dest: string) => void;
    defineBuilding: (
        context: ContextWithoutFunctions,
        props: BuildingProps,
        components: Component[],
    ) => void;
    defineDamage: (
        context: ContextWithoutFunctions,
        props: DamageProps,
    ) => DamageArmorCategoryDefId;
    defineDamageArmorCategory: (
        context: ContextWithoutFunctions,
        props: DamageArmorCategoryProps,
    ) => DamageArmorCategoryDefId;
    defineResearchProject: (
        context: ContextWithoutFunctions,
        props: ResearchProjectProps,
    ) => ResearchProjectDefId;
    defineResearchTab: (
        context: ContextWithoutFunctions,
        props: ResearchTabProps,
    ) => ResearchTabDefId;
    defineStat: (
        context: ContextWithoutFunctions,
        props: StatProps,
    ) => StatDefId;
    defineTerrainAffordance: (
        context: ContextWithoutFunctions,
        props: TerrainAffordanceProps,
    ) => TerrainAffordanceDefId;
    defineThing: (
        context: ContextWithoutFunctions,
        nodes: XmlNode[],
        components: Component[],
    ) => ThingDefId;
    defineWeapon: (
        context: ContextWithoutFunctions,
        props: ThingProps,
        components: Component[],
    ) => ThingDefId;
    getPath: (ctx: ContextWithoutFunctions, path: string) => string;
    registerDef: <T extends string>(
        ctx: ContextWithoutFunctions,
        def: XmlNode,
    ) => DefId<T>;
    writeXmlFile: (
        ctx: ContextWithoutFunctions,
        path: string,
        xml: XmlNode,
    ) => void;
} = ...

Source§

const random: (
    options?: RandomUUIDOptions,
) => `${string}-${string}-${string}-${string}-${string}` = randomUUID

Functions§

Source§

bindContext<
    T extends ContextWithoutFunctions,
    Fns extends Record<string, Function>,
>(
    ctx: T,
    fns: Fns,
): T & {
    [K in string | number | symbol]: Fns[K] extends (
        ctx: T,
        ...args: P,
    ) => R
        ? (...args: P) => R
        : never
}

Source§

toVec(arr: number[]): string

References§

Source§

bundleTextures

Source§

copyFile

Source§

getPath

Source§

IO_CONTEXT_BINDINGS

Source§

writeXmlFile

Source§

x

Source§

xls

Source§

XmlAttrs

Source§

XmlChild

Source§

XmlNode

Interfaces§

ContextWithoutFunctions