@stencila/types
Version:
JavaScript classes and TypeScript types for the Stencila Schema
38 lines (31 loc) • 867 B
text/typescript
// Generated file; do not edit. See https://github.com/stencila/stencila/tree/main/rust/schema-gen
import { Block } from "./Block.js";
import { Entity } from "./Entity.js";
import { SectionType } from "./SectionType.js";
/**
* A section of a document.
*/
export class Section extends Entity {
// @ts-expect-error 'not assignable to the same property in base type'
type: "Section";
/**
* The content within the section.
*/
content: Block[];
/**
* The type of section.
*/
sectionType?: SectionType;
constructor(content: Block[], options?: Partial<Section>) {
super();
this.type = "Section";
if (options) Object.assign(this, options);
this.content = content;
}
}
/**
* Create a new `Section`
*/
export function section(content: Block[], options?: Partial<Section>): Section {
return new Section(content, options);
}