Blockbench Reference Docs
    Preparing search index...

    Interface CodecOptions

    interface CodecOptions {
        export_action?: Action;
        export_options?: { [key: string]: FormElement };
        extension?: string;
        load_filter?: {
            condition?: any;
            extensions: string[];
            type: "json" | "text";
        };
        name: string;
        remember?: boolean;
        support_partial_export?: boolean;
        afterDownload?(path: any): void;
        afterSave?(path: any): void;
        compile?(options?: any): any;
        dispatchEvent?(event_name: string, data: any): void;
        export?(): void;
        exportCollection?(collection: Collection): void;
        fileName?(): string;
        load?(model: any, file: FileResult, args?: LoadOptions): void;
        overwrite?(content: any, path: string, callback: (path: any) => void): void;
        parse?(data: any, path: string, args?: LoadOptions): void;
        startPath?(): string;
        write?(content: any, path: string): void;
        writeCollection?(collection: Collection): void;
    }
    Index

    Properties

    export_action?: Action

    Default action that is used to export to the codec

    export_options?: { [key: string]: FormElement }

    List of export option inputs, based on the Dialog form API

    extension?: string
    load_filter?: { condition?: any; extensions: string[]; type: "json" | "text" }
    name: string
    remember?: boolean

    Whether to remember the models exported using this codec

    support_partial_export?: boolean

    Whether the codec can be used to export a part of the model via a collection

    Methods

    • Parameters

      • event_name: string
      • data: any

      Returns void

    • Parameters

      • content: any
      • path: string
      • callback: (path: any) => void

      Returns void