Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

Domain

Data models shared by the docgen parser, checker, and printer.

17 exports Since v0.6.0 Source

Errors

Error reported when documentation generation cannot continue.

Signature

declare class DocgenError extends YieldableError<this> & {
readonly _tag: "DocgenError";
} & Readonly<{
readonly message: string;
}> {
constructor(args: {
readonly message: string;
});
}

Models

Since v0.6.0

Parsed documentation model for a class and its documented members.

Signature

declare class Class extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position, methods: readonly Array<DocEntry>, staticMethods: readonly Array<DocEntry>, properties: readonly Array<DocEntry>);
readonly _tag: "Class";
readonly methods: readonly Array<DocEntry>;
readonly properties: readonly Array<DocEntry>;
readonly staticMethods: readonly Array<DocEntry>;
}
Since v0.6.0

Parsed documentation model for a constant.

Signature

declare class Constant extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position);
readonly _tag: "Constant";
}
Since v0.6.0

Parsed JSDoc content attached to a declaration or module.

Signature

declare class Doc {
constructor(description: string | undefined, since: readonly Array<string>, deprecated: readonly Array<string>, examples: readonly Array<string>, category: readonly Array<string>, throws: readonly Array<string>, sees: readonly Array<string>, tags: Record<string, ReadonlyArray<string> | undefined>);
readonly category: readonly Array<string>;
readonly deprecated: readonly Array<string>;
readonly description: string | undefined;
readonly examples: readonly Array<string>;
readonly sees: readonly Array<string>;
readonly since: readonly Array<string>;
readonly tags: Record<string, ReadonlyArray<string> | undefined>;
readonly throws: readonly Array<string>;
modifyDescription(description: string | undefined): Doc;
}
Since v0.6.0

Base model for a named, documented declaration.

Signature

declare class DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position);
readonly doc: Doc;
readonly name: string;
readonly position: Position;
readonly signature: string;
}
Since v0.6.0

Parsed documentation model for an explicit named or namespace export.

Signature

declare class Export extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position, isNamespaceExport: boolean);
readonly _tag: "Export";
readonly isNamespaceExport: boolean;
}
Since v0.6.0

Represents a file which can be optionally overwriteable.

Signature

declare class File {
constructor(path: string, content: string, isOverwriteable: boolean);
readonly content: string;
readonly isOverwriteable: boolean;
readonly path: string;
}
Since v0.6.0

Parsed documentation model for a function.

Signature

declare class Function extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position);
readonly _tag: "Function";
}

Parsed documentation model for an interface.

Signature

declare class Interface extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position);
readonly _tag: "Interface";
}
Since v0.6.0

Parsed documentation model for one source module.

Signature

declare class Module {
constructor(source: SourceShape, name: string, doc: Doc, path: readonly [string, string], classes: readonly Array<Class>, interfaces: readonly Array<Interface>, functions: readonly Array<Function>, typeAliases: readonly Array<TypeAlias>, constants: readonly Array<Constant>, exports: readonly Array<Export>, namespaces: readonly Array<Namespace>);
readonly classes: readonly Array<Class>;
readonly constants: readonly Array<Constant>;
readonly doc: Doc;
readonly exports: readonly Array<Export>;
readonly functions: readonly Array<Function>;
readonly interfaces: readonly Array<Interface>;
readonly name: string;
readonly namespaces: readonly Array<Namespace>;
readonly path: readonly [string, string];
readonly source: SourceShape;
readonly typeAliases: readonly Array<TypeAlias>;
}

Parsed documentation model for a namespace and its nested declarations.

Signature

declare class Namespace {
constructor(name: string, doc: Doc, position: Position, interfaces: readonly Array<Interface>, typeAliases: readonly Array<TypeAlias>, namespaces: readonly Array<Namespace>);
readonly _tag: "Namespace";
readonly doc: Doc;
readonly interfaces: readonly Array<Interface>;
readonly name: string;
readonly namespaces: readonly Array<Namespace>;
readonly position: Position;
readonly typeAliases: readonly Array<TypeAlias>;
}

Position

interface
Since v0.6.0

One-based source position used in diagnostics.

Signature

interface Position {
readonly column: number;
readonly line: number;
}

Parsed documentation model for a type alias.

Signature

declare class TypeAlias extends DocEntry {
constructor(name: string, doc: Doc, signature: string, position: Position);
readonly _tag: "TypeAlias";
}

Services

Since v0.6.0

Represents a handle to the currently executing process.

Signature

declare class Process extends Shape<"@effect/docgen/Process", {
readonly argv: Effect<Array<string>>;
readonly cwd: Effect<string>;
readonly env: Effect<Record<string, string>>;
readonly platform: Effect<Platform>;
}, this> {
constructor(_: never);
static readonly layer: Layer<Process, never, never>;
}

Sorting

Since v0.6.0

A comparator function for sorting Module objects by their file path, represented as a string. The file path is converted to lowercase before comparison.

Signature

declare const ByPath: Order.Order<Module>

Symbols

Type ID for DocgenError.

Signature

declare const DocgenErrorTypeId: typeof DocgenErrorTypeId

Type-level representation of DocgenErrorTypeId.

Signature

type DocgenErrorTypeId = typeof DocgenErrorTypeId