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