Skip to main content

Api

Models

Instances

Constructors

Renderers

Utilities

Models

ApiItem

A union of all API items

Signature

export type ApiItem = Interface | Function | TypeAlias | Variable | Class

Details

  • Added in 0.1.0

Class

Represents a class

Signature

export interface Class extends DocumentableItem {
readonly _tag: 'Class'
readonly constructorExcerpt: O.Option<string>
readonly members: ReadonlyArray<ClassMember>
readonly signatureExcerpt: string
}

Details

  • Added in 0.1.0

ClassMember

Represents a class property or method

Signature

export interface ClassMember extends DocumentableItem {
readonly _tag: 'ClassProperty'
readonly isProtected: boolean
readonly signatureExcerpt: string
readonly type: 'property' | 'method'
}

Details

  • Added in 0.1.0

DocumentableItem

Common documentable item properties

Signature

export interface DocumentableItem {
readonly category: O.Option<string>
readonly deprecated: boolean
readonly deprecationSchedule: O.Option<string>
readonly examples: O.Option<RNEA.ReadonlyNonEmptyArray<readonly [language: string, code: string]>>
readonly licenses: O.Option<RNEA.ReadonlyNonEmptyArray<string>>
readonly name: string
readonly releaseTag: 'public' | 'beta' | 'alpha'
readonly remarks: O.Option<string>
readonly removalSchedule: O.Option<string>
readonly since: O.Option<string>
readonly summary: O.Option<string>
}

Details

  • Added in 0.1.0

Function

Represents a function

Signature

export interface Function extends DocumentableItem {
readonly _tag: 'Function'
readonly overloadExcerpts: ReadonlyArray<string>
}

Details

  • Added in 0.1.0

Interface

Represents an interface

Signature

export interface Interface extends DocumentableItem {
readonly _tag: 'Interface'
readonly childExcerpts: ReadonlyArray<string>
readonly signatureExcerpt: string
}

Details

  • Added in 0.1.0

Module

A collection of documentation items for a single module

Signature

export interface Module {
readonly interfaces: ReadonlyArray<Interface>
readonly moduleExports: ReadonlyArray<Function | Variable | Class>
readonly typeAliases: ReadonlyArray<TypeAlias>
}

Details

  • Added in 0.1.0

NamedModule

A named module

Signature

export interface NamedModule extends Module, DocumentableItem {}

Details

  • Added in 0.1.0

TypeAlias

Represents a type alias

Signature

export interface TypeAlias extends DocumentableItem {
readonly _tag: 'TypeAlias'
readonly signatureExcerpt: string
}

Details

  • Added in 0.1.0

Variable

Represents an exported variable

Signature

export interface Variable extends DocumentableItem {
readonly _tag: 'Variable'
readonly signatureExcerpt: string
}

Details

  • Added in 0.1.0

Instances

MonoidModule

A monoid for Module

Signature

export declare const MonoidModule: Mn.Monoid<Module>

Details

  • Added in 0.1.0

Constructors

classMethod

Represents a class method

Signature

export declare const classMethod: (
name: string,
signatureExcerpt: string,
config?: Partial<DocumentableItem>,
) => ClassMember

Details

  • Added in 0.1.0

classProperty

Represents a class property

Signature

export declare const classProperty: (
name: string,
signatureExcerpt: string,
config?: Partial<DocumentableItem>,
) => ClassMember

Details

  • Added in 0.1.0

defaultDocumentableItem

A default documentable item

Signature

export declare const defaultDocumentableItem: (name: string) => DocumentableItem

Details

  • Added in 0.1.0

module

Represents a collection of documentation exports for a single module

Signature

export declare const module: (
interfaces: ReadonlyArray<Interface>,
typeAliases: ReadonlyArray<TypeAlias>,
moduleExports: ReadonlyArray<Function | Variable | Class>,
) => Module

Details

  • Added in 0.1.0

namedModule

Represents a named module

Signature

export declare const namedModule: (
name: string,
modules?: Partial<Module>,
config?: Partial<DocumentableItem>,
) => NamedModule

Details

  • Added in 0.1.0

typeAlias

Represents an exported type alias

Signature

export declare const typeAlias: (
name: string,
signatureExcerpt: string,
config?: Partial<DocumentableItem>,
) => TypeAlias

Details

  • Added in 0.1.0

variable

Represents an exported variable

Signature

export declare const variable: (name: string, signatureExcerpt: string, config?: Partial<DocumentableItem>) => Variable

Details

  • Added in 0.1.0

Renderers

renderApiItem

Prints a module to markdown

Remarks

toMarkdown will print and ApiItem to markdown in the following format:

  • Title - Summary - Remarks - Signature - Details - Example - Licenses

And will format the signature using Prettier.formatCode

Signature

export declare const renderApiItem: (api: ApiItem) => RTE.ReaderTaskEither<Prettier.PrettierConfig, never, Md.Markdown>

Details

  • Added in 0.1.0

renderModule

Prints a module to markdown

Signature

export declare const renderModule: (
namedModule: NamedModule,
) => RTE.ReaderTaskEither<Prettier.PrettierConfig, never, Md.Markdown>

Details

  • Added in 0.1.0

Utilities

class

Signature

export declare const class_: (
name: string,
signatureExcerpt: string,
members: ReadonlyArray<ClassMember>,
config?: Partial<DocumentableItem>,
) => Class

function

Signature

export declare const function_: (
name: string,
overloadExcerpts: ReadonlyArray<string>,
config?: Partial<DocumentableItem>,
) => Function

interface

Signature

export declare const interface_: (
name: string,
signatureExcerpt: string,
childExcerpts: ReadonlyArray<string>,
config?: Partial<DocumentableItem>,
) => Interface