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