api.exchange
ExchangeApi
The file formats behind File ▸ Import / Export: .trg and the strings text.
The file formats File ▸ Import / Export read and write, so a plugin can keep triggers or strings outside the map in a form the editor (and SCMDraft) take back.
Members
encodeTrg
encodeTrg(triggers: TriggerRecord[]): Uint8Array;
Raw 2400-byte TRIG records, SCMDraft's .trg; string indices are the map's own.
decodeTrg
decodeTrg(bytes: Uint8Array): TriggerRecord[];
formatStrings
formatStrings(): string;
The whole string table as index<TAB>text lines, control bytes as <XX>.
parseStrings
parseStrings(text: string): StringImport;
Parse that form (errors names the lines that were not N<TAB>text); tx.strings.import applies it.
Types
Declarations only this group names.
StringImportinterface
interface StringImport
entries: { index: number; text: string; }[] | |
|---|---|
errors: { line: number; message: string; }[] | Lines that were not |