import { File } from '../models/store/File.js';
import { ApiFileKind } from '../models/kinds.js';
/**
 * Used by the store. A file definition for the ApiModel.
 */
export class ApiFile extends File {
    kind = ApiFileKind;
    static fromName(name) {
        return super.fromName(name, ApiFileKind);
    }
    /**
     * Creates the file definition for a DomainNamespace contents.
     *
     * @param input The data namespace instance or schema.
     */
    static fromApiModel(input) {
        let final;
        if (typeof input.toJSON === 'function') {
            final = input.toJSON();
        }
        else {
            final = input;
        }
        return new ApiFile({ key: final.key, info: final.info });
    }
    constructor(state = {}) {
        super({ ...state, kind: ApiFileKind });
    }
    static isApiFile(input) {
        const typed = input;
        if (!input || typed.kind !== ApiFileKind) {
            return false;
        }
        return true;
    }
    toJSON() {
        const result = {
            ...super.toJSON(),
            kind: ApiFileKind,
        };
        return result;
    }
}
//# sourceMappingURL=ApiFile.js.map