Skip to content

⬅️ Back to Table of Contents

📄 ExportNamedDeclaration/spec

📊 Analysis Summary

Metric Count
📦 Imports 8
📐 Interfaces 4
📑 Type Aliases 2

📚 Table of Contents

🛠️ File Location:

📂 packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts

📦 Imports

Name Source
AST_NODE_TYPES ../../ast-node-types
BaseNode ../../base/BaseNode
StringLiteral ../../expression/literal/StringLiteral/spec
ExportSpecifier ../../special/ExportSpecifier/spec
ExportSpecifierWithIdentifierLocal ../../special/ExportSpecifier/spec
ImportAttribute ../../special/ImportAttribute/spec
NamedExportDeclarations ../../unions/ExportDeclaration
ExportKind ../ExportAndImportKind

Interfaces

ExportNamedDeclarationBase

Interface Code
interface ExportNamedDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.ExportNamedDeclaration;
  /**
   * The assertions declared for the export.
   * @example
   * ```ts
   * export { foo } from 'mod' assert \{ type: 'json' \};
   * ```
   * This will be an empty array if `source` is `null`
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * The attributes declared for the export.
   * @example
   * ```ts
   * export { foo } from 'mod' with \{ type: 'json' \};
   * ```
   * This will be an empty array if `source` is `null`
   */
  attributes: ImportAttribute[];
  /**
   * The exported declaration.
   * @example
   * ```ts
   * export const x = 1;
   * ```
   * This will be `null` if `source` is not `null`, or if there are `specifiers`
   */
  declaration: NamedExportDeclarations | null;
  /**
   * The kind of the export.
   */
  exportKind: ExportKind;
  /**
   * The source module being exported from.
   */
  source: StringLiteral | null;
  /**
   * The specifiers being exported.
   * @example
   * ```ts
   * export { a, b };
   * ```
   * This will be an empty array if `declaration` is not `null`
   */
  specifiers: ExportSpecifier[];
}

Properties

Name Type Optional Description
type AST_NODE_TYPES.ExportNamedDeclaration not shown
assertions ImportAttribute[] not shown
attributes ImportAttribute[] not shown
declaration NamedExportDeclarations \| null not shown
exportKind ExportKind not shown
source StringLiteral \| null not shown
specifiers ExportSpecifier[] not shown

ExportNamedDeclarationWithoutSourceWithMultiple

Interface Code
export interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase {
  /**
   * This will always be an empty array.
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * This will always be an empty array.
   */
  attributes: ImportAttribute[];
  declaration: null;
  source: null;
  // Cannot have literal local without a source
  specifiers: ExportSpecifierWithIdentifierLocal[];
}

Properties

Name Type Optional Description
assertions ImportAttribute[] not shown
attributes ImportAttribute[] not shown
declaration null not shown
source null not shown
specifiers ExportSpecifierWithIdentifierLocal[] not shown

ExportNamedDeclarationWithoutSourceWithSingle

Interface Code
export interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase {
  /**
   * This will always be an empty array.
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * This will always be an empty array.
   */
  attributes: ImportAttribute[];
  declaration: NamedExportDeclarations;
  source: null;
  /**
   * This will always be an empty array.
   */
  specifiers: ExportSpecifierWithIdentifierLocal[];
}

Properties

Name Type Optional Description
assertions ImportAttribute[] not shown
attributes ImportAttribute[] not shown
declaration NamedExportDeclarations not shown
source null not shown
specifiers ExportSpecifierWithIdentifierLocal[] not shown

ExportNamedDeclarationWithSource

Interface Code
export interface ExportNamedDeclarationWithSource extends ExportNamedDeclarationBase {
  declaration: null;
  source: StringLiteral;
}

Properties

Name Type Optional Description
declaration null not shown
source StringLiteral not shown

Type Aliases

ExportNamedDeclarationWithoutSource

type ExportNamedDeclarationWithoutSource = | ExportNamedDeclarationWithoutSourceWithMultiple
  | ExportNamedDeclarationWithoutSourceWithSingle;

ExportNamedDeclaration

type ExportNamedDeclaration = | ExportNamedDeclarationWithoutSourceWithMultiple
  | ExportNamedDeclarationWithoutSourceWithSingle
  | ExportNamedDeclarationWithSource;

Generated by Syntax Scribe