sc4
Version:
A command line utility for automating SimCity 4 modding tasks & modifying savegames
49 lines (48 loc) • 2.1 kB
TypeScript
import type { Constructor, UnknownRecord } from 'type-fest';
import type { uint32, TGILiteral } from 'sc4/types';
import type { InspectOptionsStylized } from 'node:util';
export * from './node-builtins.js';
export declare function getUnixFromJulian(d: number): number;
export declare function getJulianFromUnix(ms: number | Date): number;
export declare function invertMap<K, V>(map: Map<K, V>): Map<V, K>;
export declare function invert(obj: UnknownRecord): any;
export declare function hex(nr: number, pad?: number): string;
export declare namespace hex {
var register: () => void;
}
export declare const inspect: {
symbol: symbol;
type(value: any): any;
constructor(value: Constructor<any> | string): {
[x: symbol]: () => string;
};
hex(value: number, pad?: number): {
[x: symbol]: (_depth: number, opts: InspectOptionsStylized) => string;
};
tgi(object: Partial<TGILiteral>, label?: string): {
[x: symbol]: (_depth: number, opts: InspectOptionsStylized, nodeInspect: Function) => string;
};
};
export declare function randomId(opts?: {
except?: number[];
}): number;
export declare function split(buffer: Uint8Array): Uint8Array<ArrayBufferLike>[];
export declare function chunk(format: number[], str: string): string;
export declare namespace chunk {
var register: () => void;
}
export declare function bin(nr: number): string;
export declare function tgi(type: uint32, group: uint32, id: uint32): string;
export declare function getCityPath(city: string, region?: string): string;
export declare function duplicateAsync<Y, R, N>(generator: (...args: any[]) => Generator<Y, R, N>): {
sync(...args: any[]): R;
async(...args: any[]): Promise<R>;
};
export declare function isLittleEndian(): boolean;
export declare function isBigEndian(): boolean;
export declare function findPatternOffsets(buffer: Uint8Array, pattern: Uint8Array): number[];
export declare function attempt(fn: () => any): Promise<any[]>;
export declare function getCompressionInfo(buffer: Uint8Array): {
compressed: boolean;
size: number;
};