@gobstones/typedoc-theme-gobstones
Version:
A simple theme for the Gobstones generated documentation.
93 lines • 2.77 kB
TypeScript
import { DeclarationReflection, JSX, ParameterReflection, Reflection, SignatureReflection, SomeType, TypeContext, TypeParameterReflection } from 'typedoc';
/**
* Turn any element into it's string form.
*/
export declare const stringify: (data: unknown) => string;
/**
* A helper function for aggregation in arrays.
*/
export declare const aggregate: <T>(arr: T[], fn: (item: T) => number) => number;
/**
* Utility to help type checking ensure that there is no uncovered case.
*/
export declare const assertNever: (x: never) => never;
export type FormatterNode = {
type: 'text';
content: string;
} | {
type: 'element';
content: JSX.Element;
length: number;
} | {
type: 'line';
} | {
type: 'space_or_line';
} | {
type: 'indent';
content: FormatterNode[];
} | {
type: 'group';
id: number;
content: FormatterNode[];
} | {
type: 'nodes';
content: FormatterNode[];
} | {
type: 'if_wrap';
id: number;
true: FormatterNode;
false: FormatterNode;
};
export declare enum Wrap {
Detect = 0,
Enable = 1
}
/**
* Responsible for rendering nodes
*/
export declare class FormattedCodeGenerator {
private buffer;
private indent;
private size;
private max;
private wrapped;
constructor(maxWidth?: number, startWidth?: number);
forceWrap(wrapped: Set<number>): void;
toElement(): JSX.Element;
node(node: FormatterNode, wrap: Wrap): void;
private text;
private newLine;
}
/**
* Responsible for generating Nodes from a type tree.
*/
export declare class FormattedCodeBuilder {
readonly urlTo: (refl: Reflection) => string;
forceWrap: Set<number>;
id: number;
constructor(urlTo: (refl: Reflection) => string);
newId(): number;
type(type: SomeType | undefined, where: TypeContext, options?: {
topLevelLinks: boolean;
}): FormatterNode;
reflection(reflection: DeclarationReflection, options: {
topLevelLinks: boolean;
}): FormatterNode;
interface(item: DeclarationReflection): FormatterNode;
member(members: FormatterNode[], item: DeclarationReflection, options: {
topLevelLinks: boolean;
}): void;
signature(sig: SignatureReflection, options: {
topLevelLinks?: boolean;
hideName?: boolean;
arrowStyle?: boolean;
}): FormatterNode;
typeParameters(sig: SignatureReflection | DeclarationReflection): FormatterNode;
typeParameter(param: TypeParameterReflection): FormatterNode;
parameters(sig: SignatureReflection, id: number): FormatterNode[];
parameter(param: ParameterReflection): FormatterNode;
propertyName(reflection: Reflection, options: {
topLevelLinks?: boolean;
}): FormatterNode;
}
//# sourceMappingURL=formatter.d.ts.map