-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathglobal.d.ts
86 lines (85 loc) · 2.63 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import {WpMedia} from '@lipemat/js-boilerplate/global/wp-media';
import {WpCodeEditor} from '@lipemat/js-boilerplate/global/wp-code-editor';
import ApiFetch from '@wordpress/api-fetch';
import Autop from '@wordpress/autop';
import BlockEditor from '@wordpress/block-editor';
import BlockLibrary from '@wordpress/block-library';
import Blocks from '@wordpress/blocks';
import BlockSerialize from '@wordpress/block-serialization-default-parser';
import Commands from '@wordpress/commands';
import Components from '@wordpress/components';
import CoreData from '@wordpress/core-data';
import Data from '@wordpress/data';
import DomReady from '@wordpress/dom-ready';
import EditPost from '@wordpress/edit-post';
import EditSite from '@wordpress/edit-site';
import Editor from '@wordpress/editor';
import EscapeHtml from '@wordpress/escape-html';
import Hooks from '@wordpress/hooks';
import HtmlEntities from '@wordpress/html-entities';
import I18N from '@wordpress/i18n';
import Keycodes from '@wordpress/keycodes';
import MediaUtils from '@wordpress/media-utils';
import Plugins from '@wordpress/plugins';
import Primitives from '@wordpress/primitives';
import RichText from '@wordpress/rich-text';
import URL from '@wordpress/url';
/**
* Adds the global `wp` variable to `window` typescript definitions.
*
* May be accessed via `window.wp` and typescript will
* understand the shape.
*
* If additional declarations on the `wp` variable are needed
* simply copy/paste this block into your project and define
* additional properties.
*/
declare global {
interface Window {
ajaxurl?: string;
wp: {
apiFetch?: typeof ApiFetch,
autop?: Autop;
blockEditor?: BlockEditor;
blockLibrary?: BlockLibrary;
blocks?: Blocks,
blockSerializationDefaultParser?: BlockSerialize,
codeEditor?: WpCodeEditor;
commands?: Commands;
components?: Components;
coreData?: CoreData;
customize?: {
bind: ( event: string | 'ready', callback: () => void ) => void;
};
data?: Data;
editPost?: EditPost,
editSite?: EditSite,
editor?: Editor;
escapeHtml?: EscapeHtml;
domReady?: typeof DomReady;
hooks?: Hooks;
htmlEntities?: HtmlEntities;
i18n?: I18N;
keycodes?: Keycodes;
media?: WpMedia;
mediaUtils?: MediaUtils;
// wp_enqueue_scripts( 'password-strength-meter' );
passwordStrength?: {
meter: ( value: string, blacklist: string[] ) => number;
userInputDisallowedList: () => string[];
}
plugins?: Plugins;
primitives?: Primitives;
richText?: RichText;
url?: URL;
},
/**
* @see \wp_default_scripts()
*/
wpApiSettings?: {
root: string;
nonce: string;
versionString: string;
};
}
}