@atlaskit/editor-json-transformer
Version:
JSON transformer
76 lines (57 loc) • 1.6 kB
Markdown
<!-- API Report Version: 2.3 -->
## API Report File for "@atlaskit/editor-json-transformer"
> Do not edit this file. This report is auto-generated using
> [API Extractor](https://api-extractor.com/).
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
### Table of contents
- [Main Entry Types](#main-entry-types)
- [Peer Dependencies](#peer-dependencies)
### Main Entry Types
<!--SECTION START: Main Entry Types-->
```ts
import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
// @public (undocumented)
export type JSONDocNode = {
version: number;
type: 'doc';
content: JSONNode[];
};
// @public (undocumented)
export type JSONNode = {
type: string;
attrs?: object;
content?: Array<JSONNode | undefined>;
marks?: any[];
text?: string;
};
// @public (undocumented)
export class JSONTransformer implements Transformer_2<JSONDocNode> {
// (undocumented)
encode(node: Node_2): JSONDocNode;
encodeNode(node: Node_2): JSONNode;
// (undocumented)
parse(content: JSONDocNode, stage?: SchemaStage): Node_2;
}
// @public (undocumented)
export enum SchemaStage {
// (undocumented)
FINAL = 'final',
// (undocumented)
STAGE_0 = 'stage0',
}
// @public (undocumented)
interface Transformer_2<T> {
// (undocumented)
encode(node: Node_2): T;
// (undocumented)
parse(content: T): Node_2;
}
// (No @packageDocumentation comment for this package)
```
<!--SECTION END: Main Entry Types-->
### Peer Dependencies
<!--SECTION START: Peer Dependencies-->
```json
{}
```
<!--SECTION END: Peer Dependencies-->