-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.ts
4235 lines (4230 loc) · 90.9 KB
/
index.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type EmptyArray = [];
/**
* Any valid `callable` in PHP.
*/
export type Callable = any;
/**
* Timestamp in MySQL DATETIME format (`YYYY-MM-DD hh:mm:ss`).
*/
export type WP_Date_Time = string;
/**
* The data for the errors contained within the error object.
*
* Each error is represented by a property keyed by the error code, and containing error data for that code. Any given error code can contain only one piece of error data, but the data can be of any type.
*/
export type WP_Error_Data =
| {
[k: string]: any;
}
| EmptyArray;
/**
* The name of an individual primitive capability or meta capability.
*/
export type WP_User_Cap_Name = string;
/**
* Timestamp in IETF RFC 3339 date-time format minus the timezone identifier (`YYYY-MM-DDThh:mm:ss`).
*/
export type WP_REST_API_Date_Time = string;
/**
* A collection of user application passwords in a REST API context.
*/
export type WP_REST_API_Application_Passwords = WP_REST_API_Application_Password[];
/**
* A collection of media attachment objects in a REST API context.
*/
export type WP_REST_API_Attachments = WP_REST_API_Attachment[];
/**
* A collection of block directory search results in a REST API context.
*/
export type WP_REST_API_Block_Directory_Items = WP_REST_API_Block_Directory_Item[];
/**
* A collection of block pattern categories in a REST API context.
*/
export type WP_REST_API_Block_Pattern_Categories = WP_REST_API_Block_Pattern_Category[];
/**
* A collection of block patterns in a REST API context.
*/
export type WP_REST_API_Block_Patterns = WP_REST_API_Block_Pattern[];
/**
* A collection of block type objects in a REST API context.
*/
export type WP_REST_API_Block_Types = WP_REST_API_Block_Type[];
/**
* A collection of reusable block objects in a REST API context.
*/
export type WP_REST_API_Blocks = WP_REST_API_Block[];
/**
* A post category object in a REST API context.
*/
export type WP_REST_API_Category = WP_REST_API_Term;
/**
* A collection of post category objects in a REST API context.
*/
export type WP_REST_API_Categories = WP_REST_API_Category[];
/**
* A collection of comment objects in a REST API context.
*/
export type WP_REST_API_Comments = WP_REST_API_Comment[];
/**
* A collection of font collection objects in a REST API context.
*/
export type WP_REST_API_Font_Collections = WP_REST_API_Font_Collection[];
/**
* A collection of font face objects in a REST API context.
*/
export type WP_REST_API_Font_Faces = WP_REST_API_Font_Face[];
/**
* A collection of font family objects in a REST API context.
*/
export type WP_REST_API_Font_Families = WP_REST_API_Font_Family[];
/**
* A collection of global styles variations in a REST API context.
*/
export type WP_REST_API_Global_Style_Variations = {
/**
* Version number of the global styles variation.
*/
version: number;
/**
* Global styles.
*/
styles?: {
[k: string]: unknown;
};
/**
* Global settings.
*/
settings?: {
[k: string]: unknown;
};
/**
* Title of the global styles variation.
*/
title: string;
[k: string]: unknown;
}[];
/**
* A collection of menu items in a REST API context.
*/
export type WP_REST_API_Menu_Items = WP_REST_API_Menu_Item[];
/**
* A collection of menus in a REST API context.
*/
export type WP_REST_API_Menus = WP_REST_API_Menu[];
/**
* A navigation menu object in a REST API context.
*/
export type WP_REST_API_Navigation_Menu = WP_REST_API_Partial_Post_Common;
/**
* A collection of navigation menu objects in a REST API context.
*/
export type WP_REST_API_Navigation_Menus = WP_REST_API_Navigation_Menu[];
/**
* A page object in a REST API context.
*/
export type WP_REST_API_Page = WP_REST_API_Partial_Post_Common &
WP_REST_API_Partial_Post_Author &
WP_REST_API_Partial_Post_Public &
WP_REST_API_Partial_Post_Comments &
WP_REST_API_Partial_Post_Excerpt & {
/**
* The embedded representation of relations. Only present when the '_embed' query parameter is set.
*/
_embedded?: {
/**
* The author of the page.
*/
author: unknown[];
/**
* The replies to the page (comments, pingbacks, trackbacks).
*/
replies?: unknown[];
/**
* The taxonomy terms for the page.
*/
"wp:term"?: unknown[];
/**
* The featured image page.
*/
"wp:featuredmedia"?: unknown[];
/**
* The parent page.
*/
up?: unknown[];
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* A collection of page objects in a REST API context.
*/
export type WP_REST_API_Pages = WP_REST_API_Page[];
/**
* A collection of patterns from the pattern directory in a REST API context.
*/
export type WP_REST_API_Pattern_Directory_Patterns = WP_REST_API_Pattern_Directory_Pattern[];
/**
* A collection of plugins in a REST API context.
*/
export type WP_REST_API_Plugins = WP_REST_API_Plugin[];
/**
* A post object in a REST API context.
*/
export type WP_REST_API_Post = WP_REST_API_Partial_Post_Common &
WP_REST_API_Partial_Post_Author &
WP_REST_API_Partial_Post_Public &
WP_REST_API_Partial_Post_Comments &
WP_REST_API_Partial_Post_Excerpt & {
/**
* The embedded representation of relations. Only present when the '_embed' query parameter is set.
*/
_embedded?: {
/**
* The author of the post.
*/
author: unknown[];
/**
* The replies to the post (comments, pingbacks, trackbacks).
*/
replies?: unknown[];
/**
* The taxonomy terms for the post.
*/
"wp:term"?: unknown[];
/**
* The featured image post.
*/
"wp:featuredmedia"?: unknown[];
/**
* The parent post.
*/
up?: unknown[];
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* A collection of post objects in a REST API context.
*/
export type WP_REST_API_Posts = WP_REST_API_Post[];
/**
* A collection of post revision objects in a REST API context.
*/
export type WP_REST_API_Revisions = WP_REST_API_Revision[];
/**
* A collection of search result objects in a REST API context.
*/
export type WP_REST_API_Search_Results = WP_REST_API_Search_Result[];
/**
* A post tag object in a REST API context.
*/
export type WP_REST_API_Tag = WP_REST_API_Term;
/**
* A collection of post tag objects in a REST API context.
*/
export type WP_REST_API_Tags = WP_REST_API_Tag[];
/**
* A collection of term objects in a REST API context.
*/
export type WP_REST_API_Terms = WP_REST_API_Term[];
/**
* UTC timestamp in IETF RFC 3339 date-time format (`YYYY-MM-DDThh:mm:ss+00:00`).
*/
export type WP_REST_API_Date_Time_UTC = string;
/**
* A collection of user objects in a REST API context.
*/
export type WP_REST_API_Users = WP_REST_API_User[];
/**
* WordPress is open source software you can use to create a beautiful website, blog, or app.
*/
export interface WP {
Block_Template: WP_Block_Template;
Block_Type: WP_Block_Type;
Block: WP_Block;
Comment: WP_Comment;
Error_With_Error: WP_Error_With_Error;
Error_Without_Error: WP_Error_Without_Error;
Error: WP_Error;
Locale: WP_Locale;
Network: WP_Network;
Post_Type: WP_Post_Type;
Post: WP_Post;
Query: WP_Query;
Role: WP_Role;
Screen: WP_Screen;
Site: WP_Site;
Taxonomy: WP_Taxonomy;
Term: WP_Term;
User: WP_User;
REST_API: {
Application_Password: WP_REST_API_Application_Password;
Application_Passwords: WP_REST_API_Application_Passwords;
Attachment: WP_REST_API_Attachment;
Attachments: WP_REST_API_Attachments;
Block_Directory_Item: WP_REST_API_Block_Directory_Item;
Block_Directory_Items: WP_REST_API_Block_Directory_Items;
Block_Pattern_Categories: WP_REST_API_Block_Pattern_Categories;
Block_Pattern_Category: WP_REST_API_Block_Pattern_Category;
Block_Pattern: WP_REST_API_Block_Pattern;
Block_Patterns: WP_REST_API_Block_Patterns;
Block_Type: WP_REST_API_Block_Type;
Block_Types: WP_REST_API_Block_Types;
Block: WP_REST_API_Block;
Blocks: WP_REST_API_Blocks;
Categories: WP_REST_API_Categories;
Category: WP_REST_API_Category;
Comment: WP_REST_API_Comment;
Comments: WP_REST_API_Comments;
Font_Collection: WP_REST_API_Font_Collection;
Font_Collections: WP_REST_API_Font_Collections;
Font_Face: WP_REST_API_Font_Face;
Font_Faces: WP_REST_API_Font_Faces;
Font_Families: WP_REST_API_Font_Families;
Font_Family: WP_REST_API_Font_Family;
Global_Style_Config: WP_REST_API_Global_Style_Config;
Global_Style_Variation: WP_REST_API_Global_Style_Variation;
Global_Style_Variations: WP_REST_API_Global_Style_Variations;
Menu_Item: WP_REST_API_Menu_Item;
Menu_Items: WP_REST_API_Menu_Items;
Menu_Location: WP_REST_API_Menu_Location;
Menu_Locations: WP_REST_API_Menu_Locations;
Menu: WP_REST_API_Menu;
Menus: WP_REST_API_Menus;
Navigation_Menu: WP_REST_API_Navigation_Menu;
Navigation_Menus: WP_REST_API_Navigation_Menus;
Page: WP_REST_API_Page;
Pages: WP_REST_API_Pages;
Pattern_Directory_Pattern: WP_REST_API_Pattern_Directory_Pattern;
Pattern_Directory_Patterns: WP_REST_API_Pattern_Directory_Patterns;
Plugin: WP_REST_API_Plugin;
Plugins: WP_REST_API_Plugins;
Post: WP_REST_API_Post;
Posts: WP_REST_API_Posts;
Rendered_Block: WP_REST_API_Rendered_Block;
Revision: WP_REST_API_Revision;
Revisions: WP_REST_API_Revisions;
Search_Result: WP_REST_API_Search_Result;
Search_Results: WP_REST_API_Search_Results;
Settings: WP_REST_API_Settings;
Status: WP_REST_API_Status;
Statuses: WP_REST_API_Statuses;
Tag: WP_REST_API_Tag;
Tags: WP_REST_API_Tags;
Taxonomies: WP_REST_API_Taxonomies;
Taxonomy: WP_REST_API_Taxonomy;
Term: WP_REST_API_Term;
Terms: WP_REST_API_Terms;
Type: WP_REST_API_Type;
Types: WP_REST_API_Types;
User: WP_REST_API_User;
Users: WP_REST_API_Users;
Error: WP_REST_API_Error;
};
}
/**
* Core class representing a block template.
*/
export interface WP_Block_Template {
type: string;
theme: string;
slug: string;
id: string;
title: string;
content: string;
description: string;
source: string;
origin: string | null;
wp_id: number | null;
status: string;
has_theme_file: boolean;
is_custom: boolean;
author: number | null;
plugin: string | null;
post_types: string[] | null;
area: string | null;
modified: string | null;
}
/**
* Core class representing a block type.
*/
export interface WP_Block_Type {
/**
* Block API version.
*/
api_version: number;
/**
* Block type key.
*/
name: string;
/**
* Human-readable block type label.
*/
title: string;
/**
* Block type category classification, used in search interfaces to arrange block types by category.
*/
category: string | null;
/**
* Setting parent lets a block require that it is only available when nested within the specified blocks.
*/
parent: string[] | null;
/**
* Setting ancestor makes a block available only inside the specified block types at any position of the ancestor's block subtree.
*/
ancestor: string[] | null;
/**
* Block type icon.
*/
icon: string | null;
/**
* A detailed block type description.
*/
description: string;
/**
* Additional keywords to produce block type as result in search interfaces.
*/
keywords: string[];
/**
* The translation textdomain.
*/
textdomain: string | null;
/**
* Alternative block styles.
*/
styles: unknown[];
/**
* Block variations.
*/
variations?: unknown[];
/**
* Block hooks for this block type.
*/
block_hooks:
| EmptyArray
| {
[k: string]: string;
};
/**
* Allowed child block types.
*/
allowed_blocks: string[] | null;
/**
* Block variations callback.
*/
variation_callback: Callable | null;
/**
* Block type front end only script module IDs.
*/
view_script_module_ids: string[];
/**
* Block type front end only style handles.
*/
view_style_handles: string[];
/**
* Custom CSS selectors for theme.json style generation.
*/
selectors?:
| EmptyArray
| {
[k: string]: unknown;
};
/**
* Supported features.
*/
supports: {
[k: string]: unknown;
} | null;
/**
* Structured data for the block preview.
*/
example:
| EmptyArray
| {
[k: string]: unknown;
}
| null;
/**
* Block type render callback.
*/
render_callback: Callable | null;
/**
* Block type attributes property schemas.
*/
attributes:
| EmptyArray
| {
[k: string]: unknown;
}
| null;
/**
* Context provided by blocks of this type.
*/
provides_context: {
[k: string]: string;
} | null;
/**
* Block type editor script handle.
*/
editor_script?: string | null;
/**
* Block type editor only script handles.
*/
editor_script_handles: string[];
/**
* Block type front end script handle.
*/
script?: string | null;
/**
* Block type front end and editor script handles.
*/
script_handles: string[];
/**
* Public facing script handle.
*/
view_script?: string | null;
/**
* Block type front end only script handles.
*/
view_script_handles: string[];
/**
* Block type editor style handle.
*/
editor_style?: string | null | false;
/**
* Block type editor only style handles.
*/
editor_style_handles: string[];
/**
* Block type front end style handle.
*/
style?: string | null | false;
/**
* Block type front end and editor style handles.
*/
style_handles: string[];
skip_inner_blocks?: boolean;
}
/**
* Class representing a parsed instance of a block.
*/
export interface WP_Block {
/**
* Original parsed array representation of block.
*/
parsed_block: WP_Block_Parsed;
/**
* Name of block.
*/
name: string;
/**
* Block type associated with the instance.
*/
block_type: WP_Block_Type;
/**
* Block context values.
*/
context:
| {
[k: string]: unknown;
}
| EmptyArray;
/**
* List of inner blocks (of this same class). Note that this is always empty as it represents a WP_Block_List instance which has no public properties.
*/
inner_blocks: EmptyArray | EmptyObject;
/**
* Resultant HTML from inside block comment delimiters after removing inner blocks.
*/
inner_html: string;
/**
* List of string fragments and null markers where inner blocks were found.
*/
inner_content: (string | null)[];
/**
* Attributes validated against the current block schema, populating defaulted and missing values. Lazily loaded, so not always present.
*/
attributes?: {
[k: string]: any;
};
}
/**
* Original parsed array representation of block.
*/
export interface WP_Block_Parsed {
/**
* Name of block.
*/
blockName: string;
attrs:
| {
[k: string]: any;
}
| EmptyArray;
/**
* List of inner blocks (of this same class).
*/
innerBlocks: WP_Block_Parsed[];
/**
* Resultant HTML from inside block comment delimiters after removing inner blocks.
*/
innerHTML: string;
/**
* List of string fragments and null markers where inner blocks were found.
*/
innerContent: (string | null)[];
}
export interface EmptyObject {}
/**
* Core class used to organize comments as instantiated objects with defined members.
*/
export interface WP_Comment {
/**
* Comment ID.
*
* A numeric string, for compatibility reasons.
*/
comment_ID: string;
/**
* ID of the post the comment is associated with.
*
* A numeric string, for compatibility reasons.
*/
comment_post_ID: string;
/**
* Comment author name.
*/
comment_author: string;
/**
* Comment author email address.
*/
comment_author_email: string | "";
/**
* Comment author URL.
*/
comment_author_url: string | "";
/**
* Comment author IP address (IPv4 format).
*/
comment_author_IP: string | "";
/**
* Comment date in YYYY-MM-DD HH:MM:SS format.
*/
comment_date: WP_Date_Time;
/**
* Comment GMT date in YYYY-MM-DD HH::MM:SS format.
*/
comment_date_gmt: WP_Date_Time;
/**
* Comment content.
*/
comment_content: string;
/**
* Comment karma count.
*
* A numeric string, for compatibility reasons.
*/
comment_karma: string;
/**
* Comment approval status.
*/
comment_approved: "0" | "1" | "spam" | "trash";
/**
* Comment author HTTP user agent.
*/
comment_agent: string;
/**
* Comment type.
*/
comment_type: WP_Comment_Type_Name | string;
/**
* Parent comment ID.
*
* A numeric string, for compatibility reasons.
*/
comment_parent: string;
/**
* Comment author ID.
*
* A numeric string, for compatibility reasons.
*/
user_id: string;
}
/**
* WordPress Error class.
*
* Represents a WP_Error object that contains at least one error.
*/
export interface WP_Error_With_Error {
/**
* Stores the list of errors.
*/
errors: WP_Error_Messages;
/**
* Stores the list of data for error codes.
*/
error_data: WP_Error_Data;
}
/**
* The messages for the errors contained within the error object.
*
* Each error is represented by a property keyed by the error code, and containing an array of message strings for that code. Any given error code usually contains only one message, but can contain more.
*/
export interface WP_Error_Messages {
[k: string]: string[];
}
/**
* Empty WordPress Error class.
*
* Represents a WP_Error object that contains no errors.
*/
export interface WP_Error_Without_Error {
/**
* Stores the list of errors.
*/
errors: EmptyArray;
/**
* Stores the list of data for error codes.
*/
error_data: EmptyArray;
}
/**
* WordPress Error class.
*
* Container for checking for WordPress errors and error messages. Many core WordPress functions pass this class in the event of an error.
*/
export interface WP_Error {
/**
* Stores the list of errors.
*/
errors: EmptyArray | WP_Error_Messages;
/**
* Stores the list of data for error codes.
*/
error_data: WP_Error_Data;
}
/**
* Core class used to store translated data for a locale.
*/
export interface WP_Locale {
/**
* Stores the translated strings for the full weekday names.
*/
weekday: string[];
/**
* Stores the translated strings for the one character weekday names.
*/
weekday_initial: {
[k: string]: string;
};
/**
* Stores the translated strings for the abbreviated weekday names.
*/
weekday_abbrev: {
[k: string]: string;
};
/**
* The separator string used for localizing list item separator.
*/
list_item_separator: string;
/**
* Stores the translated strings for the full month names.
*/
month: {
"10": string;
"11": string;
"12": string;
"01": string;
"02": string;
"03": string;
"04": string;
"05": string;
"06": string;
"07": string;
"08": string;
"09": string;
};
/**
* Stores the translated strings for the month names in genitive case, if the locale specifies.
*/
month_genitive: {
"10": string;
"11": string;
"12": string;
"01": string;
"02": string;
"03": string;
"04": string;
"05": string;
"06": string;
"07": string;
"08": string;
"09": string;
};
/**
* Stores the translated strings for the abbreviated month names.
*/
month_abbrev: {
[k: string]: string;
};
/**
* Stores the translated strings for 'am', 'pm', 'AM', and 'PM'.
*/
meridiem: {
am: string;
pm: string;
AM: string;
PM: string;
};
/**
* The text direction of the locale language.
*/
text_direction: "ltr" | "rtl";
/**
* The thousands separator and decimal point values used for localizing numbers.
*/
number_format: {
thousands_sep: string;
decimal_point: string;
};
/**
* The word count type of the locale language.
*/
word_count_type: "words" | "characters_excluding_spaces" | "characters_including_spaces";
}
/**
* Core class used for interacting with a multisite network.
*/
export interface WP_Network {
/**
* Domain of the network.
*/
domain: string;
/**
* Path of the network.
*/
path: string;
/**
* Domain used to set cookies for this network.
*/
cookie_domain: string;
/**
* Name of this network.
*
* Named "site" vs. "network" for legacy reasons.
*/
site_name: string;
}
/**
* Core class used for interacting with post types.
*/
export interface WP_Post_Type {
/**
* Post type key.
*/
name: WP_Post_Type_Name | string;
/**
* Name of the post type shown in the menu. Usually plural.
*/
label: string;
/**
* Labels object for this post type.
*/
labels: WP_Post_Type_Labels;
/**
* A short descriptive summary of what the post type is.
*/
description: string;
/**
* Whether a post type is intended for use publicly either via the admin interface or by front-end users.
*/
public: boolean;
/**
* Whether the post type is hierarchical.
*/
hierarchical: boolean;
/**
* Whether to exclude posts with this post type from front end search results.
*/
exclude_from_search: boolean;
/**
* Whether queries can be performed on the front end for the post type as part of `parse_request()`.
*/
publicly_queryable: boolean;
/**
* Whether to generate and allow a UI for managing this post type in the admin.
*/
show_ui: boolean;
/**
* Where to show the post type in the admin menu.
*/
show_in_menu: boolean | string;
/**
* Makes this post type available for selection in navigation menus.
*/
show_in_nav_menus: boolean;
/**
* Makes this post type available via the admin bar.
*/
show_in_admin_bar: boolean;
/**
* The position in the menu order the post type should appear.
*/
menu_position: number | null;
/**
* The URL or reference to the icon to be used for this menu. Can include a URL, a base64-encoded SVG using a data URI, the name of a Dashicons helper class, or 'none'. Can include null for post types without a UI.
*/
menu_icon: string | "none" | null;
/**
* The string to use to build the read, edit, and delete capabilities.
*/
capability_type: string;
/**
* Whether to use the internal default meta capability handling.
*/
map_meta_cap: boolean;
/**
* Provide a callback function that sets up the meta boxes for the edit form.
*/
register_meta_box_cb: Callable | null;
/**
* An array of taxonomy identifiers that will be registered for the post type.
*/
taxonomies: (WP_Taxonomy_Name | string)[];
/**
* Whether there should be post type archives, or if a string, the archive slug to use.
*/
has_archive: boolean | string;
/**
* Sets the query_var key for this post type.
*/
query_var: string | boolean;
/**
* Whether to allow this post type to be exported.
*/
can_export: boolean;
/**
* Whether to delete posts of this type when deleting a user.
*/
delete_with_user: boolean | null;
/**
* Array of blocks to use as the default initial state for an editor session.
*/
template: unknown[];
/**
* Whether the block template should be locked if $template is set.
*/
template_lock: false | "all" | "insert";
/**
* Whether this post type is a native or 'built-in' post_type.
*/
_builtin: boolean;
/**
* URL segment to use for edit link of this post type.
*/
_edit_link: string;
/**
* Post type capabilities.
*/
cap: WP_Post_Type_Caps;
/**
* Triggers the handling of rewrites for this post type.
*/
rewrite: WP_Post_Type_Rewrite | boolean;
/**
* The features supported by the post type.
*/
supports?: {
[k: string]: unknown;
};
/**
* Whether this post type should appear in the REST API.
*/
show_in_rest: boolean;
/**
* The base path for this post type's REST API endpoints.
*/
rest_base: string | boolean;
/**
* The namespace for this post type's REST API endpoints.
*/
rest_namespace: string | boolean;
/**
* The controller for this post type's REST API endpoints.
*/
rest_controller_class: string | false;
/**
* The controller for this post type's revisions REST API endpoints.
*/
revisions_rest_controller_class: string | false;
/**
* The controller for this post type's autosave REST API endpoints.
*/
autosave_rest_controller_class: string | false;
/**
* The controller instance for this post type's REST API endpoints.
*/
rest_controller: {
[k: string]: unknown;
};
/**
* The controller instance for this post type's revisions REST API endpoints.
*/
revisions_rest_controller: {
[k: string]: unknown;
};
/**
* The controller instance for this post type's autosave REST API endpoints.
*/
autosave_rest_controller: {
[k: string]: unknown;
};
/**
* A flag to register the post type REST API controller after its associated autosave / revisions controllers, instead of before. Registration order affects route matching priority.
*/
late_route_registration: boolean;
}
/**
* Post type labels.
*/
export interface WP_Post_Type_Labels {
name: string;
singular_name: string;