"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isImportDeclaration = exports.ImportDeclaration = exports.isSpecifier = void 0;
/*
This file was generated from ion source. Do not edit.
*/
const ImportSpecifier = __importStar(require("./ImportSpecifier"));
const ImportDefaultSpecifier = __importStar(require("./ImportDefaultSpecifier"));
const ImportNamespaceSpecifier = __importStar(require("./ImportNamespaceSpecifier"));
const Location = __importStar(require("./Location"));
const Null = __importStar(require("./ion/Null"));
const Type = __importStar(require("./Type"));
const Integer = __importStar(require("./ion/Integer"));
const _Array = __importStar(require("./ion/Array"));
const Literal = __importStar(require("./Literal"));
const String = __importStar(require("./ion/String"));
const Class = __importStar(require("./ion/Class"));
function isSpecifier(value) {
    return ImportSpecifier.isImportSpecifier(value) || (ImportDefaultSpecifier.isImportDefaultSpecifier(value) || ImportNamespaceSpecifier.isImportNamespaceSpecifier(value));
}
exports.isSpecifier = isSpecifier;
class ImportDeclaration {
    constructor({ location = null, type = null, export: _export = 0, specifiers, path = null, source, absoluteSource = null }) {
        if (!(Location.isLocation(location) || Null.isNull(location)))
            throw new Error('location is not a Location | Null: ' + Class.toString(location));
        if (!(Type.isType(type) || Null.isNull(type)))
            throw new Error('type is not a Type | Null: ' + Class.toString(type));
        if (!Integer.isInteger(_export))
            throw new Error('export is not a Integer: ' + Class.toString(_export));
        if (!_Array.isArray(specifiers))
            throw new Error('specifiers is not a Array: ' + Class.toString(specifiers));
        if (!(_Array.isArray(path) || Null.isNull(path)))
            throw new Error('path is not a Array | Null: ' + Class.toString(path));
        if (!Literal.isLiteral(source))
            throw new Error('source is not a Literal: ' + Class.toString(source));
        if (!(String.isString(absoluteSource) || Null.isNull(absoluteSource)))
            throw new Error('absoluteSource is not a String | Null: ' + Class.toString(absoluteSource));
        this.location = location;
        this.type = type;
        this.export = _export;
        this.specifiers = specifiers;
        this.path = path;
        this.source = source;
        this.absoluteSource = absoluteSource;
        Object.freeze(this);
    }
    patch(properties) {
        return new ImportDeclaration({
            ...this,
            ...properties
        });
    }
    static is(value) {
        return isImportDeclaration(value);
    }
}
exports.ImportDeclaration = ImportDeclaration;
ImportDeclaration.id = 'ImportDeclaration';
ImportDeclaration.implements = new Set([
    'ImportDeclaration',
    'ion_Object',
    'Declaration',
    'Statement',
    'Exportable',
    'Typed',
    'Node'
]);
function isImportDeclaration(value) {
    return Class.isInstance(ImportDeclaration, value);
}
exports.isImportDeclaration = isImportDeclaration;
exports.default = ImportDeclaration;
