nextpress-core 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/acf-functions/core/acf-builder.d.ts +1 -0
  2. package/dist/acf-functions/core/acf-field-group-autoloader.d.ts +1 -0
  3. package/dist/acf-functions/index.d.ts +13 -0
  4. package/dist/acf-functions/index.js +13 -0
  5. package/dist/acf-functions/services/define-field-group.d.ts +1 -0
  6. package/dist/acf-functions/services/define-layout.d.ts +1 -0
  7. package/dist/acf-functions/services/map-fields/helpers/map-choice-object.d.ts +1 -1
  8. package/dist/acf-functions/services/map-fields/map-fields.d.ts +3 -0
  9. package/dist/acf-functions/types/acf-field-group.d.ts +99 -0
  10. package/dist/acf-functions/types/acf-field-group.js +1 -0
  11. package/dist/acf-functions/types/acf-field.d.ts +2813 -0
  12. package/dist/acf-functions/types/acf-field.js +1 -0
  13. package/dist/acf-functions/types/acf-layout.d.ts +19 -0
  14. package/dist/acf-functions/types/acf-layout.js +1 -0
  15. package/dist/acf-functions/types/acf-values.d.ts +4 -0
  16. package/dist/acf-functions/types/acf-values.js +1 -0
  17. package/dist/acf-functions/types/components/field-props.d.ts +196 -0
  18. package/dist/acf-functions/types/components/field-props.js +1 -0
  19. package/dist/acf-functions/types/components/nextpress-component.d.ts +11 -0
  20. package/dist/acf-functions/types/components/nextpress-component.js +1 -0
  21. package/dist/entities/common.d.ts +28 -0
  22. package/dist/entities/common.js +1 -0
  23. package/dist/entities/index.d.ts +9 -0
  24. package/dist/entities/index.js +9 -0
  25. package/dist/entities/option/option.interface.d.ts +7 -0
  26. package/dist/entities/option/option.interface.js +2 -0
  27. package/dist/entities/post/post.interface.d.ts +67 -0
  28. package/dist/entities/post/post.interface.js +2 -0
  29. package/dist/entities/term/term.interface.d.ts +8 -0
  30. package/dist/entities/term/term.interface.js +1 -0
  31. package/dist/entities/user/user.interface.d.ts +9 -0
  32. package/dist/entities/user/user.interface.js +1 -0
  33. package/dist/globals/entity-loader/entity-loader-base.d.ts +1 -1
  34. package/dist/globals/entity-loader/entity-loader.interface.d.ts +52 -0
  35. package/dist/globals/entity-loader/entity-loader.interface.js +1 -0
  36. package/dist/globals/entity-loader/option-loader.d.ts +1 -1
  37. package/dist/globals/entity-loader/post-loader.d.ts +1 -1
  38. package/dist/globals/entity-loader/term-loader.d.ts +1 -1
  39. package/dist/globals/entity-loader/user-loader.d.ts +1 -1
  40. package/dist/globals/get-field/get-field.d.ts +2 -1
  41. package/dist/globals/index.d.ts +10 -0
  42. package/dist/globals/index.js +10 -0
  43. package/dist/globals/nextpress-config/nextpress-config.interface.d.ts +14 -0
  44. package/dist/globals/nextpress-config/nextpress-config.interface.js +1 -0
  45. package/dist/repository/index.d.ts +5 -0
  46. package/dist/repository/index.js +5 -0
  47. package/dist/repository/optionquery/option-query-args.d.ts +19 -0
  48. package/dist/repository/optionquery/option-query-args.js +1 -0
  49. package/dist/repository/optionquery/option-query.d.ts +1 -1
  50. package/dist/repository/postquery/post-query-args.d.ts +104 -0
  51. package/dist/repository/postquery/post-query-args.js +1 -0
  52. package/dist/repository/postquery/post-query.d.ts +1 -1
  53. package/dist/repository/termquery/term-query-args.d.ts +51 -0
  54. package/dist/repository/termquery/term-query-args.js +1 -0
  55. package/dist/repository/termquery/term-query.d.ts +1 -1
  56. package/dist/repository/userquery/user-query-args.d.ts +63 -0
  57. package/dist/repository/userquery/user-query-args.js +1 -0
  58. package/dist/repository/userquery/user-query.d.ts +1 -1
  59. package/dist/router/index.d.ts +17 -0
  60. package/dist/router/index.js +17 -0
  61. package/dist/router/router.d.ts +1 -1
  62. package/dist/router/router.js +1 -1
  63. package/dist/router/types.d.ts +8 -0
  64. package/dist/router/types.js +1 -0
  65. package/dist/services/index.d.ts +10 -0
  66. package/dist/services/index.js +10 -0
  67. package/dist/ui/index.d.ts +4 -0
  68. package/dist/ui/index.js +4 -0
  69. package/dist/ui/render-components.d.ts +1 -1
  70. package/dist/wpdb/index.d.ts +0 -0
  71. package/dist/wpdb/index.js +1 -0
  72. package/dist/wpdb/wpdb.interface.d.ts +152 -0
  73. package/dist/wpdb/wpdb.interface.js +5 -0
  74. package/package.json +32 -4
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ACFField, NextpressField } from "./acf-field";
2
+ type TransformACFLayout<T> = T extends any ? Omit<T, 'key' | 'sub_fields'> & ('sub_fields' extends keyof T ? {
3
+ sub_fields: NextpressField[];
4
+ } : []) : never;
5
+ /** ACF Layout without key constraints to allow key generation */
6
+ export type NextpressLayout = TransformACFLayout<ACFLayout>;
7
+ /**
8
+ * Represents a layout within an ACF Flexible Content field.
9
+ */
10
+ export type ACFLayout = {
11
+ key: string;
12
+ name: string;
13
+ label: string;
14
+ display: 'table' | 'block' | 'row';
15
+ sub_fields: ACFField[];
16
+ min?: string;
17
+ max?: string;
18
+ };
19
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Represents raw ACF values retrieved from the database.
3
+ */
4
+ export type ACFRawValues = Map<string, string>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,196 @@
1
+ import { IPost } from "@/entities/post/post.interface";
2
+ import { ITerm } from "@/entities/term/term.interface";
3
+ import { IUser } from "@/entities/user/user.interface";
4
+ import { JSX } from "react";
5
+ type GetFields<T> = T extends {
6
+ fields: readonly any[];
7
+ } ? T['fields'] : T extends {
8
+ sub_fields: readonly any[];
9
+ } ? T['sub_fields'] : never;
10
+ /**
11
+ * Represents the properties passed to a Nextpress ACF component.
12
+ *
13
+ * @template T - The expected type of the mapped ACF fields.
14
+ */
15
+ export type FieldProps<LayoutT> = LayoutT extends {
16
+ fields: readonly any[];
17
+ } | {
18
+ sub_fields: readonly any[];
19
+ } ? ResolvedFields<GetFields<LayoutT>> : never;
20
+ /**
21
+ * An array of ACF field configurations to a strongly-typed object representing the resolved data structure.
22
+ * It iterates over the array, using the `name` property of each field as the object key, and determines the expected value type using the `MapFieldType` utility.
23
+ *
24
+ * @template Fields - A readonly array of ACF field configuration objects.
25
+ */
26
+ export type ResolvedFields<Fields extends readonly any[]> = {
27
+ [F in Fields[number] as F['name']]: MapFieldType<F>;
28
+ };
29
+ /**
30
+ * Maps an array of ACF Flexible Content layouts to a union type representing the resolved layout blocks.
31
+ * For each layout, it checks for the presence of `fields` or `sub_fields`, and resolves to a specific object
32
+ * structure containing the layout's React component and its deeply resolved field content.
33
+ *
34
+ * @template Layouts - A readonly array of ACF Flexible Content layout configuration objects.
35
+ */
36
+ export type ResolvedFlexibleContent<Layouts extends readonly any[]> = {
37
+ [L in Layouts[number] as L['name']]: L extends {
38
+ name: infer Name;
39
+ } & ({
40
+ fields: readonly any[];
41
+ } | {
42
+ sub_fields: readonly any[];
43
+ }) ? {
44
+ Component: () => Promise<JSX.Element>;
45
+ content: ResolvedFields<GetFields<L>>;
46
+ }[] : never;
47
+ }[Layouts[number]['name']];
48
+ type MapFieldType<Field> = Field extends {
49
+ type: 'color_picker';
50
+ } ? string | null : Field extends {
51
+ type: 'date_picker';
52
+ } ? string | null : Field extends {
53
+ type: 'date_time_picker';
54
+ } ? string | null : Field extends {
55
+ type: 'google_map';
56
+ } ? ACFGoogleMapsObject | null : Field extends {
57
+ type: 'icon_picker';
58
+ } ? Field extends {
59
+ return_format: 'string';
60
+ } ? string | null : Field extends {
61
+ return_format: 'array';
62
+ } ? ACFIconObject | null : ACFIconObject | null : Field extends {
63
+ type: 'time_picker';
64
+ } ? string | null : Field extends {
65
+ type: 'email';
66
+ } ? string | null : Field extends {
67
+ type: 'number';
68
+ } ? number | null : Field extends {
69
+ type: 'password';
70
+ } ? string | null : Field extends {
71
+ type: 'range';
72
+ } ? number | null : Field extends {
73
+ type: 'text';
74
+ } ? string | null : Field extends {
75
+ type: 'textarea';
76
+ } ? string | null : Field extends {
77
+ type: 'button_group';
78
+ } ? Field extends {
79
+ return_format: 'array';
80
+ } ? ACFChoiceObject | null : string | null : Field extends {
81
+ type: 'checkbox';
82
+ } ? Field extends {
83
+ return_format: 'array';
84
+ } ? ACFChoiceObject[] : string[] : Field extends {
85
+ type: 'radio';
86
+ } ? Field extends {
87
+ return_format: 'array';
88
+ } ? ACFChoiceObject | null : string | null : Field extends {
89
+ type: 'select';
90
+ } ? Field extends {
91
+ multiple: 1;
92
+ } ? Field extends {
93
+ return_format: 'array';
94
+ } ? ACFChoiceObject[] : string[] : Field extends {
95
+ return_format: 'array';
96
+ } ? ACFChoiceObject | null : string | null : Field extends {
97
+ type: 'true_false';
98
+ } ? boolean : Field extends {
99
+ type: 'file';
100
+ } ? number | null : Field extends {
101
+ type: 'gallery';
102
+ } ? number[] : Field extends {
103
+ type: 'image';
104
+ } ? number | null : Field extends {
105
+ type: 'oembed';
106
+ } ? string | null : Field extends {
107
+ type: 'wysiwyg';
108
+ } ? string | null : Field extends {
109
+ type: 'link';
110
+ } ? Field extends {
111
+ return_format: 'url';
112
+ } ? string | null : Field extends {
113
+ return_format: 'array';
114
+ } ? ACFLinkObject | null : ACFLinkObject : Field extends {
115
+ type: 'page_link';
116
+ } ? Field extends {
117
+ multiple: 1;
118
+ } ? string[] : string | null : Field extends {
119
+ type: 'post_object';
120
+ } ? Field extends {
121
+ multiple: 1;
122
+ } ? Field extends {
123
+ return_format: 'object';
124
+ } ? IPost[] : number[] : Field extends {
125
+ return_format: 'object';
126
+ } ? IPost | null : number | null : Field extends {
127
+ type: 'relationship';
128
+ } ? Field extends {
129
+ return_format: 'object';
130
+ } ? IPost[] | null : number[] | null : Field extends {
131
+ type: 'taxonomy';
132
+ } ? Field extends {
133
+ multiple: 1;
134
+ } ? Field extends {
135
+ return_format: 'object';
136
+ } ? ITerm[] : number[] : Field extends {
137
+ return_format: 'object';
138
+ } ? ITerm | null : number | null : Field extends {
139
+ type: 'user';
140
+ } ? Field extends {
141
+ multiple: 1;
142
+ } ? Field extends {
143
+ return_format: 'object';
144
+ } ? IUser[] : number[] : Field extends {
145
+ return_format: 'object';
146
+ } ? IUser | null : number | null : Field extends {
147
+ type: 'group';
148
+ } & ({
149
+ fields: readonly any[];
150
+ } | {
151
+ sub_fields: readonly any[];
152
+ }) ? ResolvedFields<GetFields<Field>> | null : Field extends {
153
+ type: 'repeater';
154
+ } & ({
155
+ fields: readonly any[];
156
+ } | {
157
+ sub_fields: readonly any[];
158
+ }) ? ResolvedFields<GetFields<Field>>[] | null : Field extends {
159
+ type: 'flexible_content';
160
+ layouts: readonly any[];
161
+ } ? ResolvedFlexibleContent<Field['layouts']> | null : Field extends {
162
+ fields: readonly any[];
163
+ } | {
164
+ sub_fields: readonly any[];
165
+ } ? ResolvedFields<GetFields<Field>> : never;
166
+ export type ACFIconObject = {
167
+ type: string;
168
+ value: string;
169
+ };
170
+ export type ACFLinkObject = {
171
+ title: string;
172
+ url: string;
173
+ target: string;
174
+ };
175
+ export type ACFChoiceObject = {
176
+ label?: string;
177
+ value?: string;
178
+ };
179
+ export type ACFGoogleMapsObject = {
180
+ address: string;
181
+ lat: string | number;
182
+ lng: string | number;
183
+ zoom: string | number;
184
+ place_id: string;
185
+ name: string;
186
+ street_number: string | number;
187
+ street_name: string;
188
+ street_name_short: string;
189
+ city: string;
190
+ state: string;
191
+ state_short: string;
192
+ post_code: string | number;
193
+ country: string;
194
+ country_short: string;
195
+ };
196
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { NextpressLayout } from '../acf-layout';
3
+ /**
4
+ * Represents a Next.js React component that consumes Nextpress ACF fields.
5
+ *
6
+ * @template T - The expected type of the mapped ACF fields.
7
+ */
8
+ export type NextpressComponent = {
9
+ layout: NextpressLayout;
10
+ Component: () => Promise<JSX.Element>;
11
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Represents entity with a path.
3
+ */
4
+ export interface IPath {
5
+ /** Nextpress path to entity. */
6
+ path: string;
7
+ }
8
+ /**
9
+ * Array of field key-value pairs.
10
+ */
11
+ export type Fields = {
12
+ /** Field key. */
13
+ key: string;
14
+ /** Field value. */
15
+ value: string;
16
+ }[];
17
+ /**
18
+ * Represents entity that can provide ACF fields.
19
+ */
20
+ export interface IFieldLocation {
21
+ /**
22
+ * Retrieves fields matching a name prefix.
23
+ *
24
+ * @param {string} name - Field name prefix to search for.
25
+ * @returns {Promise<Fields>} Promise resolving to array of fields.
26
+ */
27
+ getFields: (name: string) => Promise<Fields>;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export * from './common';
2
+ export * from './post/post.interface';
3
+ export * from './post/post';
4
+ export * from './user/user';
5
+ export * from './user/user.interface';
6
+ export * from './term/term.interface';
7
+ export * from './term/term';
8
+ export * from './option/option.interface';
9
+ export * from './option/option';
@@ -0,0 +1,9 @@
1
+ export * from './common';
2
+ export * from './post/post.interface';
3
+ export * from './post/post';
4
+ export * from './user/user';
5
+ export * from './user/user.interface';
6
+ export * from './term/term.interface';
7
+ export * from './term/term';
8
+ export * from './option/option.interface';
9
+ export * from './option/option';
@@ -0,0 +1,7 @@
1
+ import { Selectable } from "kysely";
2
+ import { WpOption } from "../../wpdb/wpdb.interface";
3
+ /**
4
+ * Represents option entity.
5
+ */
6
+ export interface IOption extends Omit<Selectable<WpOption>, 'autoload'> {
7
+ }
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
@@ -0,0 +1,67 @@
1
+ import { Selectable } from "kysely";
2
+ import { WpPost } from "../../wpdb/wpdb.interface";
3
+ import { IFieldLocation, IPath } from "../common";
4
+ /**
5
+ * Attributes for post attachment images.
6
+ */
7
+ export type PostImageAttributes = {
8
+ /** Image source URL. */
9
+ src?: string;
10
+ /** Image alternative text. */
11
+ alt?: string;
12
+ /** Image height. */
13
+ height?: number;
14
+ /** Image width. */
15
+ width?: number;
16
+ };
17
+ /**
18
+ * Attributes for nav menu items.
19
+ */
20
+ export type MenuItemAttributes = {
21
+ /** Menu item label. */
22
+ label: string;
23
+ /** Menu item type. */
24
+ type: 'custom' | 'post_type' | 'taxonomy';
25
+ /** Parent menu item ID. */
26
+ parentId: number;
27
+ /** Target object ID. */
28
+ objectId: number;
29
+ /** Menu item URL. */
30
+ url: string;
31
+ };
32
+ /**
33
+ * Base post properties.
34
+ */
35
+ export interface IBasePost extends Selectable<WpPost> {
36
+ }
37
+ /**
38
+ * Page post properties.
39
+ */
40
+ export interface IPagePost extends IBasePost, IPath {
41
+ }
42
+ /**
43
+ * Standard post properties.
44
+ */
45
+ export interface IPostPost extends IBasePost, IPath {
46
+ /** Featured image attachment ID. */
47
+ thumbnailId: number;
48
+ }
49
+ /**
50
+ * Attachment post properties.
51
+ */
52
+ export interface IAttachmentPost extends IBasePost {
53
+ /** Image attributes. */
54
+ imageAttributes: PostImageAttributes;
55
+ }
56
+ /**
57
+ * Menu item properties.
58
+ */
59
+ export interface IMenuItem extends IBasePost {
60
+ /** Menu item attributes. */
61
+ menuItemAttributes: MenuItemAttributes | null;
62
+ }
63
+ /**
64
+ * Comprehensive post entity encompassing all post types.
65
+ */
66
+ export interface IPost extends IBasePost, IPagePost, IPostPost, IAttachmentPost, IMenuItem, IFieldLocation {
67
+ }
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Selectable } from "kysely";
2
+ import { WpTerm, WpTermTaxonomy } from "../../wpdb/wpdb.interface";
3
+ import { IPath } from "../common";
4
+ /**
5
+ * Represents term entity.
6
+ */
7
+ export interface ITerm extends Selectable<WpTerm>, Selectable<WpTermTaxonomy>, IPath {
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Selectable } from "kysely";
2
+ import { WpUser } from "../../wpdb/wpdb.interface";
3
+ /**
4
+ * Represents user entity.
5
+ */
6
+ export interface IUser extends Selectable<WpUser> {
7
+ roles: string[];
8
+ showAdminBar: boolean;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { EntityLoader, EntityQuery } from "./entity-loader";
1
+ import { EntityLoader, EntityQuery } from "./entity-loader.interface";
2
2
  /**
3
3
  * Constructor type for entity queries.
4
4
  */
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Defines the contract for an entity loader.
3
+ *
4
+ * @template EntityT The type of entity being loaded.
5
+ * @template QueryArgsT The type of arguments used for querying the entity.
6
+ */
7
+ export interface EntityLoader<EntityT, QueryArgsT> {
8
+ /**
9
+ * Queues entity IDs for loading.
10
+ *
11
+ * @param {number[]} ids Array of entity IDs.
12
+ */
13
+ prime: (ids: number[]) => void;
14
+ /**
15
+ * Finds entity IDs based on query arguments and queues them for loading.
16
+ *
17
+ * @param {QueryArgsT} args Query arguments.
18
+ * @returns {Promise<{ids: number[], count: number}>} Array of found IDs and the total count.
19
+ * @throws {Error} If the query fails.
20
+ */
21
+ findAndPrime: (args: QueryArgsT) => Promise<{
22
+ ids: number[];
23
+ count: number;
24
+ }>;
25
+ /**
26
+ * Retrieves entities by their IDs.
27
+ *
28
+ * @param {number[]} ids Array of entity IDs.
29
+ * @returns {Promise<EntityT[]>} Array of entities.
30
+ * @throws {Error} If retrieval fails.
31
+ */
32
+ get: (ids: number[]) => Promise<EntityT[]>;
33
+ }
34
+ /**
35
+ * Defines the contract for an entity query.
36
+ *
37
+ * @template TArgs The type of query arguments.
38
+ */
39
+ export interface EntityQuery<TArgs> {
40
+ /**
41
+ * Executes the query and returns the matching entity IDs.
42
+ *
43
+ * @returns {Promise<number[]>} Array of entity IDs.
44
+ * @throws {Error} If the query fails.
45
+ */
46
+ getIds(): Promise<number[]>;
47
+ /**
48
+ * Retrieves the total count of entities matching the query.
49
+ * @returns {number | undefined} Total count, or undefined if not computed.
50
+ */
51
+ getCount(): number | undefined;
52
+ }
@@ -1,6 +1,6 @@
1
1
  import { IOption } from "../../entities/option/option.interface";
2
2
  import { OptionQueryArgs } from "../../repository/optionquery/option-query-args";
3
- import { EntityLoader } from "./entity-loader";
3
+ import { EntityLoader } from "./entity-loader.interface";
4
4
  declare global {
5
5
  /** Global instance of the OptionLoader. */
6
6
  var optionLoader: EntityLoader<IOption, OptionQueryArgs>;
@@ -1,5 +1,5 @@
1
1
  import { IPost } from "../../entities/post/post.interface";
2
- import { EntityLoader } from "./entity-loader";
2
+ import { EntityLoader } from "./entity-loader.interface";
3
3
  declare global {
4
4
  /** Global instance of the PostLoader. */
5
5
  var postLoader: EntityLoader<IPost, PostQueryArgs>;
@@ -1,5 +1,5 @@
1
1
  import { ITerm } from "../../entities/term/term.interface";
2
- import { EntityLoader } from "./entity-loader";
2
+ import { EntityLoader } from "./entity-loader.interface";
3
3
  declare global {
4
4
  /** Global instance of the TermLoader. */
5
5
  var termLoader: EntityLoader<ITerm, TermQueryArgs>;
@@ -1,5 +1,5 @@
1
1
  import { IUser } from "../../entities/user/user.interface";
2
- import { EntityLoader } from "./entity-loader";
2
+ import { EntityLoader } from "./entity-loader.interface";
3
3
  declare global {
4
4
  /** Global instance of the UserLoader. */
5
5
  var userLoader: EntityLoader<IUser, UserQueryArgs>;
@@ -1,5 +1,6 @@
1
+ import { NextpressFieldGroup } from "@/acf-functions/types/acf-field-group";
2
+ import { FieldProps } from "@/acf-functions/types/components/field-props";
1
3
  import { IFieldLocation } from "../../entities/common";
2
- import { FieldProps } from "../../acf-functions/types/components/field-props";
3
4
  /** Specifies location to retrieve fields from. */
4
5
  type Location = IFieldLocation | 'options';
5
6
  declare global {
@@ -0,0 +1,10 @@
1
+ export * from './globals';
2
+ export * from './nextpress-config/nextpress-config';
3
+ export * from './get-field/get-field';
4
+ export * from './queried-object/queried-object';
5
+ export * from './entity-loader/entity-loader-base';
6
+ export * from './entity-loader/option-loader';
7
+ export * from './entity-loader/user-loader';
8
+ export * from './entity-loader/post-loader';
9
+ export * from './entity-loader/term-loader';
10
+ export * from './entity-loader/entity-loader.interface';
@@ -0,0 +1,10 @@
1
+ export * from './globals';
2
+ export * from './nextpress-config/nextpress-config';
3
+ export * from './get-field/get-field';
4
+ export * from './queried-object/queried-object';
5
+ export * from './entity-loader/entity-loader-base';
6
+ export * from './entity-loader/option-loader';
7
+ export * from './entity-loader/user-loader';
8
+ export * from './entity-loader/post-loader';
9
+ export * from './entity-loader/term-loader';
10
+ export * from './entity-loader/entity-loader.interface';
@@ -0,0 +1,14 @@
1
+ type NextpressConfig = {
2
+ /** Custom taxonomies used to categorize and group content (like categories or tags). Expects the taxonomy's URL prefix, so tag instead of post_tag */
3
+ readonly publicTaxonomies?: string[];
4
+ /** Custom post types registered for public consumption (like posts, pages, or portfolio). */
5
+ readonly publicPostTypes?: string[];
6
+ /** Post types that should display archive pages on the frontend. */
7
+ readonly archivedPostTypes?: string[];
8
+ /** The word/character count limit for automatically generated post teasers. */
9
+ readonly excerptLength?: number;
10
+ /** Database option keys (from wp_options) to fetch early for performance optimization. */
11
+ readonly preLoadOptions?: string[];
12
+ } & {
13
+ [key: string]: any;
14
+ };
@@ -0,0 +1,5 @@
1
+ export * from './userquery/user-query';
2
+ export * from './termquery/term-query';
3
+ export * from './optionquery/option-query';
4
+ export * from './optionquery/option-query-args';
5
+ export * from './postquery/post-query';
@@ -0,0 +1,5 @@
1
+ export * from './userquery/user-query';
2
+ export * from './termquery/term-query';
3
+ export * from './optionquery/option-query';
4
+ export * from './optionquery/option-query-args';
5
+ export * from './postquery/post-query';
@@ -0,0 +1,19 @@
1
+ import { DB } from "@/wpdb/wpdb.interface";
2
+ import { ComparisonOperatorExpression, ReferenceExpression } from "kysely";
3
+ /**
4
+ * Defines the arguments for querying options.
5
+ */
6
+ export interface OptionQueryArgs {
7
+ /**
8
+ * Database column reference to query against.
9
+ */
10
+ column: ReferenceExpression<DB, "wpOptions">;
11
+ /**
12
+ * Comparison operator for the query.
13
+ */
14
+ operand?: ComparisonOperatorExpression;
15
+ /**
16
+ * Value or array of values to compare.
17
+ */
18
+ value: string | string[];
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { EntityQuery } from "../../globals/entity-loader/entity-loader";
1
+ import { EntityQuery } from "../../globals/entity-loader/entity-loader.interface";
2
2
  import { OptionQueryArgs } from "./option-query-args";
3
3
  import { IOption } from "../../entities/option/option.interface";
4
4
  /**