@stencila/types
Version:
JavaScript classes and TypeScript types for the Stencila Schema
45 lines (37 loc) • 1.01 kB
text/typescript
// Generated file; do not edit. See https://github.com/stencila/stencila/tree/main/rust/schema-gen
import { Author } from "./Author.js";
import { Entity } from "./Entity.js";
import { Inline } from "./Inline.js";
import { Integer } from "./Integer.js";
/**
* A heading.
*/
export class Heading extends Entity {
// @ts-expect-error 'not assignable to the same property in base type'
type: "Heading";
/**
* The level of the heading.
*/
level: Integer = 0;
/**
* Content of the heading.
*/
content: Inline[];
/**
* The authors of the heading.
*/
authors?: Author[];
constructor(level: Integer, content: Inline[], options?: Partial<Heading>) {
super();
this.type = "Heading";
if (options) Object.assign(this, options);
this.level = level;
this.content = content;
}
}
/**
* Create a new `Heading`
*/
export function heading(level: Integer, content: Inline[], options?: Partial<Heading>): Heading {
return new Heading(level, content, options);
}