import type { ArrowFunctionExpr, ClassExpr, Expr, FunctionExpr, Identifier, ObjectLiteralExpr, OmittedExpr, PropName, ReferenceExpr } from "./expression";
import type { Integration } from "./integration";
import { BaseNode, FunctionlessNode } from "./node";
import { NodeKind } from "./node-kind";
import type { Span } from "./span";
import type { BlockStmt, CatchClause, ForInStmt, ForOfStmt, ForStmt, VariableStmt } from "./statement";
import type { AnyClass, AnyFunction } from "./util";
export declare type Decl = BindingElem | ClassDecl | ClassMember | FunctionDecl | ParameterDecl | VariableDecl;
declare abstract class BaseDecl<Kind extends NodeKind, Parent extends FunctionlessNode | undefined = FunctionlessNode | undefined> extends BaseNode<Kind, Parent> {
    readonly nodeKind: "Decl";
}
export declare class ClassDecl<C extends AnyClass = AnyClass> extends BaseDecl<NodeKind.ClassDecl, BlockStmt | undefined> {
    readonly name: Identifier;
    readonly heritage: Expr | undefined;
    readonly members: ClassMember[];
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename?: string | undefined;
    readonly _classBrand?: C;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: Identifier, heritage: Expr | undefined, members: ClassMember[], 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename?: string | undefined);
}
export declare type ClassMember = ClassStaticBlockDecl | ConstructorDecl | GetAccessorDecl | MethodDecl | PropDecl | SetAccessorDecl;
export declare class ClassStaticBlockDecl extends BaseDecl<NodeKind.ClassStaticBlockDecl, ClassDecl | ClassExpr> {
    readonly block: BlockStmt;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, block: BlockStmt);
}
export declare class ConstructorDecl extends BaseDecl<NodeKind.ConstructorDecl> {
    readonly parameters: ParameterDecl[];
    readonly body: BlockStmt;
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename: string | undefined;
    /**
     * The class or object that owns this {@link ConstructorDecl}.
     *
     * This value is only set if this {@link ConstructorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   constructor() {}
     * }
     * ```
     */
    readonly ownedBy: ReferenceExpr<AnyClass | object> | undefined;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, parameters: ParameterDecl[], body: BlockStmt, 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename: string | undefined, 
    /**
     * The class or object that owns this {@link ConstructorDecl}.
     *
     * This value is only set if this {@link ConstructorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   constructor() {}
     * }
     * ```
     */
    ownedBy: ReferenceExpr<AnyClass | object> | undefined);
}
export declare class MethodDecl<F extends AnyFunction = AnyFunction> extends BaseDecl<NodeKind.MethodDecl, ClassDecl | ClassExpr | undefined> {
    readonly name: PropName;
    readonly parameters: ParameterDecl[];
    readonly body: BlockStmt;
    /**
     * true if this function has an `async` modifier
     * ```ts
     * class Foo {
     *   async foo() {}
     *
     *   // asterisk can co-exist
     *   async *foo() {}
     * }
     * ```
     */
    readonly isAsync: boolean;
    /**
     * true if this function has an `*` modifier
     *
     * ```ts
     * class Foo {
     *   foo*() {}
     *
     *   // async can co-exist
     *   async *foo() {}
     * }
     * ```
     */
    readonly isAsterisk: boolean;
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename: string | undefined;
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static method() {
     *     return value;
     *   }
     * }
     * ```
     */
    readonly isStatic: boolean | undefined;
    /**
     * The class or object that owns this {@link MethodDecl}.
     *
     * This value is only set if this {@link MethodDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   static method() {
     *     return value;
     *   }
     * }
     * ```
     */
    readonly ownedBy: ReferenceExpr<AnyClass | object> | undefined;
    __methodBrand: F;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: PropName, parameters: ParameterDecl[], body: BlockStmt, 
    /**
     * true if this function has an `async` modifier
     * ```ts
     * class Foo {
     *   async foo() {}
     *
     *   // asterisk can co-exist
     *   async *foo() {}
     * }
     * ```
     */
    isAsync: boolean, 
    /**
     * true if this function has an `*` modifier
     *
     * ```ts
     * class Foo {
     *   foo*() {}
     *
     *   // async can co-exist
     *   async *foo() {}
     * }
     * ```
     */
    isAsterisk: boolean, 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename: string | undefined, 
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static method() {
     *     return value;
     *   }
     * }
     * ```
     */
    isStatic: boolean | undefined, 
    /**
     * The class or object that owns this {@link MethodDecl}.
     *
     * This value is only set if this {@link MethodDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   static method() {
     *     return value;
     *   }
     * }
     * ```
     */
    ownedBy: ReferenceExpr<AnyClass | object> | undefined);
}
export declare class PropDecl extends BaseDecl<NodeKind.PropDecl, ClassDecl | ClassExpr> {
    /**
     * Name of the {@link PropDecl}.
     *
     * ```ts
     * class Foo {
     *   prop;
     * // ^
     * }
     * ```
     */
    readonly name: PropName;
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static prop: string = ?
     * }
     * ```
     */
    readonly isStatic: boolean;
    /**
     * An optional initializer for the property.
     *
     * ```ts
     * class Foo {
     *   prop = <expr>
     *         // ^
     * }
     * ```
     */
    readonly initializer: Expr | undefined;
    /**
     * A reference to the {@link ClassDecl} or {@link ClassExpr} instance that owns this {@link PropDecl}
     *
     * This value is only set if this {@link PropDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   static prop: string = ?
     * }
     * ```
     */
    readonly ownedBy: ReferenceExpr<AnyClass> | undefined;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, 
    /**
     * Name of the {@link PropDecl}.
     *
     * ```ts
     * class Foo {
     *   prop;
     * // ^
     * }
     * ```
     */
    name: PropName, 
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static prop: string = ?
     * }
     * ```
     */
    isStatic: boolean, 
    /**
     * An optional initializer for the property.
     *
     * ```ts
     * class Foo {
     *   prop = <expr>
     *         // ^
     * }
     * ```
     */
    initializer: Expr | undefined, 
    /**
     * A reference to the {@link ClassDecl} or {@link ClassExpr} instance that owns this {@link PropDecl}
     *
     * This value is only set if this {@link PropDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * class Foo {
     *     // ^
     *   static prop: string = ?
     * }
     * ```
     */
    ownedBy: ReferenceExpr<AnyClass> | undefined);
}
export declare class GetAccessorDecl<F extends () => any = () => any> extends BaseDecl<NodeKind.GetAccessorDecl, ClassDecl | ClassExpr | ObjectLiteralExpr> {
    readonly name: PropName;
    readonly body: BlockStmt;
    /**
     * `true` if this is a static getter on a class.
     *
     * ```ts
     * class Foo {
     *   static get getter() {
     *     return value;
     *   }
     * }
     * ```
     */
    readonly isStatic: boolean | undefined;
    /**
     * The class or object that owns this {@link GetAccessorDecl}. This value is only set
     * if this {@link GetAccessorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * const object = {
     *     // ^
     *   get getter() {
     *     return value;
     *   }
     * }
     *
     * class Foo {
     *     // ^
     *   get getter() {
     *     return value;
     *   }
     * }
     * ```
     */
    readonly ownedBy: ReferenceExpr<AnyClass | object> | undefined;
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename?: string | undefined;
    __getterBrand: F;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: PropName, body: BlockStmt, 
    /**
     * `true` if this is a static getter on a class.
     *
     * ```ts
     * class Foo {
     *   static get getter() {
     *     return value;
     *   }
     * }
     * ```
     */
    isStatic: boolean | undefined, 
    /**
     * The class or object that owns this {@link GetAccessorDecl}. This value is only set
     * if this {@link GetAccessorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * const object = {
     *     // ^
     *   get getter() {
     *     return value;
     *   }
     * }
     *
     * class Foo {
     *     // ^
     *   get getter() {
     *     return value;
     *   }
     * }
     * ```
     */
    ownedBy: ReferenceExpr<AnyClass | object> | undefined, 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename?: string | undefined);
}
export declare class SetAccessorDecl<F extends (val: any) => typeof val = (val: any) => typeof val> extends BaseDecl<NodeKind.SetAccessorDecl, ClassDecl | ClassExpr | ObjectLiteralExpr> {
    readonly name: PropName;
    /**
     * ```ts
     * class Foo {
     *   static get setter(value) {
     *                   // ^
     *     _value = value;
     *   }
     * }
     * ```
     */
    readonly parameter: ParameterDecl | undefined;
    readonly body: BlockStmt;
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static get setter(value) {
     *     _value = value;
     *   }
     * }
     * ```
     */
    readonly isStatic: boolean | undefined;
    /**
     * The class or object that owns this {@link SetAccessorDecl}. This value is only set
     * if this {@link SetAccessorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * const object = {
     *     // ^
     *   get setter(value) {
     *     _value = value;
     *   }
     * }
     *
     * class Foo {
     *     // ^
     *   get setter(value) {
     *     _value = value;
     *   }
     * }
     * ```
     */
    readonly ownedBy: ReferenceExpr<AnyClass | object> | undefined;
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename?: string | undefined;
    __setterBrand: F;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: PropName, 
    /**
     * ```ts
     * class Foo {
     *   static get setter(value) {
     *                   // ^
     *     _value = value;
     *   }
     * }
     * ```
     */
    parameter: ParameterDecl | undefined, body: BlockStmt, 
    /**
     * `true` if this is a static setter on a class.
     *
     * ```ts
     * class Foo {
     *   static get setter(value) {
     *     _value = value;
     *   }
     * }
     * ```
     */
    isStatic: boolean | undefined, 
    /**
     * The class or object that owns this {@link SetAccessorDecl}. This value is only set
     * if this {@link SetAccessorDecl} is the root node in the tree (parent === undefined).
     *
     * ```ts
     * const object = {
     *     // ^
     *   get setter(value) {
     *     _value = value;
     *   }
     * }
     *
     * class Foo {
     *     // ^
     *   get setter(value) {
     *     _value = value;
     *   }
     * }
     * ```
     */
    ownedBy: ReferenceExpr<AnyClass | object> | undefined, 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename?: string | undefined);
}
export declare type FunctionLike<F extends AnyFunction = AnyFunction> = FunctionDecl<F> | FunctionExpr<F> | ArrowFunctionExpr<F>;
export declare class FunctionDecl<F extends AnyFunction = AnyFunction> extends BaseDecl<NodeKind.FunctionDecl, BlockStmt | undefined> {
    readonly name: string | undefined;
    readonly parameters: ParameterDecl[];
    readonly body: BlockStmt;
    /**
     * true if this function has an `async` modifier
     * ```ts
     * async function foo() {}
     * // asterisk can co-exist
     * async function *foo() {}
     * ```
     */
    readonly isAsync: boolean;
    /**
     * true if this function has an `*` modifier
     *
     * ```ts
     * function foo*() {}
     *
     * // async can co-exist
     * async function *foo() {}
     * ```
     */
    readonly isAsterisk: boolean;
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    readonly filename?: string | undefined;
    readonly _functionBrand?: F;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: string | undefined, parameters: ParameterDecl[], body: BlockStmt, 
    /**
     * true if this function has an `async` modifier
     * ```ts
     * async function foo() {}
     * // asterisk can co-exist
     * async function *foo() {}
     * ```
     */
    isAsync: boolean, 
    /**
     * true if this function has an `*` modifier
     *
     * ```ts
     * function foo*() {}
     *
     * // async can co-exist
     * async function *foo() {}
     * ```
     */
    isAsterisk: boolean, 
    /**
     * Name of the source file this node originates from.
     *
     * Only set on the root of the tree, i.e. when `this` is `undefined`.
     */
    filename?: string | undefined);
}
export interface IntegrationInvocation {
    integration: Integration<any>;
    args: Expr[];
}
export declare class ParameterDecl extends BaseDecl<NodeKind.ParameterDecl, ArrowFunctionExpr | FunctionDecl | FunctionExpr | SetAccessorDecl> {
    readonly name: BindingName;
    readonly initializer: Expr | undefined;
    /**
     * Whether this ParameterDecl is a rest parameter
     * ```ts
     * function foo(...rest) {}
     * ```
     */
    readonly isRest: boolean;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: BindingName, initializer: Expr | undefined, 
    /**
     * Whether this ParameterDecl is a rest parameter
     * ```ts
     * function foo(...rest) {}
     * ```
     */
    isRest: boolean);
}
export declare type BindingPattern = ObjectBinding | ArrayBinding;
export declare type BindingName = Identifier | BindingPattern;
/**
 * A binding element declares new variable or acts as the root to a nested {@link BindingPattern}
 * when destructuring an object or an array.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
 *
 * It represents a single named element in a {@link BindingPattern}.
 *
 * ```ts
 * const { a } = right;
 *      // ^ BindingElm
 * const [ a ] = right;
 *      // ^ BindingElm
 * ```
 *
 * * `a` - creates a variable called a with the value of the right side (`const a = right.a`).
 * * `a: b` - creates a variable called b with the value of the right side (`const b = right.a`).
 * * `a = "value"` - creates a variable called a with the value of the right side or "value" when the right side is undefined (`const a = right.a ?? "value"`)
 * * `a: { b }` - creates a variable called b with the value of the right side's a value. (`const b = right.a.b`)
 * * `...rest`- creates a variable called rest with all of the unused keys in the right side
 *
 * > Note: for {@link ArrayBinding}, the accessor will be a numeric index instead of a named property
 * > `const a = right[0]`
 *
 * Rest (`...rest`) example:
 *
 * ```ts
 * const val = { a: 1, b:2 };
 * const { a, ...rest } = val;
 *             // ^ { b: 2 }
 * ```
 */
export declare class BindingElem extends BaseDecl<NodeKind.BindingElem, BindingPattern> {
    readonly name: BindingName;
    readonly rest: boolean;
    readonly propertyName?: PropName | undefined;
    readonly initializer?: Expr | undefined;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: BindingName, rest: boolean, propertyName?: PropName | undefined, initializer?: Expr | undefined);
}
/**
 * Extract properties or sub-objects out of an object.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
 *
 * Container of {@link BindingElem}.
 *
 * ```ts
 * const { a: { b = "value" }, ...rest } = obj;
 * ```
 *
 * is the same as
 *
 * ```ts
 * const b = obj.a.b ?? "value"
 * const rest = { ...obj };
 * delete rest.a;
 * ```
 *
 * @see BindingElm for more details.
 */
export declare class ObjectBinding extends BaseNode<NodeKind.ObjectBinding, VariableDecl> {
    readonly bindings: BindingElem[];
    readonly nodeKind: "Node";
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, bindings: BindingElem[]);
}
/**
 * Extract properties or sub-objects out of an array.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
 *
 * Container of {@link BindingElem}.
 *
 * ```ts
 * const [ a: [ b = "value" ], ...rest ] = arr;
 * ```
 *
 * is the same as
 *
 * ```ts
 * const b = arr[0][0] ?? "value";
 * const rest = arr.slice(1);
 * ```
 *
 * @see BindingElm for more details.
 */
export declare class ArrayBinding extends BaseNode<NodeKind.ArrayBinding, VariableDecl> {
    readonly bindings: (BindingElem | OmittedExpr)[];
    readonly nodeKind: "Node";
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, bindings: (BindingElem | OmittedExpr)[]);
}
export declare type VariableDeclParent = CatchClause | ForInStmt | ForOfStmt | VariableDeclList;
export declare enum VariableDeclKind {
    Const = 0,
    Let = 1,
    Var = 2
}
export declare class VariableDecl<E extends Expr | undefined = Expr | undefined> extends BaseDecl<NodeKind.VariableDecl, VariableDeclParent> {
    readonly name: BindingName;
    readonly initializer: E;
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, name: BindingName, initializer: E);
}
export declare type VariableDeclListParent = ForStmt | VariableStmt;
export declare type SingleEntryVariableDeclList = VariableDeclList & {
    readonly decls: [VariableDecl];
};
export declare class VariableDeclList extends BaseNode<NodeKind.VariableDeclList, VariableDeclListParent> {
    readonly decls: VariableDecl[];
    readonly varKind: VariableDeclKind;
    readonly nodeKind: "Node";
    constructor(
    /**
     * Range of text in the source file where this Node resides.
     */
    span: Span, decls: VariableDecl[], varKind: VariableDeclKind);
}
export declare const deploymentOnlyModule = true;
export {};
//# sourceMappingURL=declaration.d.ts.map