1 | import { NodeSpec, Node as PMNode } from 'prosemirror-model';
|
2 | import { BorderMarkDefinition } from '../marks/border';
|
3 | import { LinkDefinition } from '../marks/link';
|
4 | export declare type MediaType = 'file' | 'link' | 'external';
|
5 | export declare type DisplayType = 'file' | 'thumbnail';
|
6 | export declare type DefaultAttributes<T> = {
|
7 | [P in keyof T]: {
|
8 | default?: T[P] | null;
|
9 | };
|
10 | };
|
11 |
|
12 |
|
13 |
|
14 | export interface MediaDefinition {
|
15 | type: 'media';
|
16 | |
17 |
|
18 |
|
19 | attrs: MediaADFAttrs;
|
20 | marks?: Array<LinkDefinition | BorderMarkDefinition>;
|
21 | }
|
22 | export interface MediaBaseAttributes {
|
23 | |
24 |
|
25 |
|
26 | id: string;
|
27 | collection: string;
|
28 | height?: number;
|
29 | width?: number;
|
30 | |
31 |
|
32 |
|
33 | occurrenceKey?: string;
|
34 | alt?: string;
|
35 | __fileName?: string | null;
|
36 | __fileSize?: number | null;
|
37 | __fileMimeType?: string | null;
|
38 | __displayType?: DisplayType | null;
|
39 | __contextId?: string | null;
|
40 | __mediaTraceId?: string | null;
|
41 | __external?: boolean;
|
42 | }
|
43 | export interface MediaAttributes extends MediaBaseAttributes {
|
44 | type: 'file' | 'link';
|
45 | }
|
46 | export interface ExternalMediaAttributes {
|
47 | type: 'external';
|
48 | url: string;
|
49 | alt?: string;
|
50 | width?: number;
|
51 | height?: number;
|
52 | __external?: boolean;
|
53 | }
|
54 | export declare type MediaADFAttrs = MediaAttributes | ExternalMediaAttributes;
|
55 | export declare const defaultAttrs: DefaultAttributes<MediaADFAttrs>;
|
56 | export declare const createMediaSpec: (attributes: Partial<NodeSpec['attrs']>, inline?: boolean) => NodeSpec;
|
57 | export declare const media: NodeSpec;
|
58 | export declare const camelCaseToKebabCase: (str: string) => string;
|
59 | export declare const copyPrivateAttributes: (from: Record<string, any>, to: Record<string, any>, map?: ((str: string) => string) | undefined) => void;
|
60 | export declare const toJSON: (node: PMNode) => {
|
61 | attrs: Record<string, any>;
|
62 | };
|