opacacms 0.1.5 → 0.1.6

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.
@@ -1,5 +1,11 @@
1
1
  import type { Collection as BaseCollection, IconName } from "../types";
2
2
  import type { AccessRules, InferFields } from "./infer";
3
+ /**
4
+ * Factory for creating Collections.
5
+ */
6
+ export declare const Collection: {
7
+ create: (slug: string) => CollectionBuilder<{}>;
8
+ };
3
9
  /**
4
10
  * The Fluent API Collection Builder.
5
11
  */
@@ -95,6 +101,3 @@ export declare class CollectionBuilder<TFields extends Record<string, any> = {}>
95
101
  */
96
102
  build(): BaseCollection;
97
103
  }
98
- export declare const Collection: {
99
- create: (slug: string) => CollectionBuilder<{}>;
100
- };
@@ -1,4 +1,29 @@
1
1
  import { FieldBuilder } from "./base";
2
+ /**
3
+ * The Field Factory object containing methods to instantiate specific field builders.
4
+ * Defined at the top to avoid TDZ (Temporal Dead Zone) during module evaluation.
5
+ */
6
+ export declare const Field: {
7
+ text: <N extends string>(name: N) => TextFieldBuilder<N>;
8
+ slug: <N extends string>(name: N) => SlugFieldBuilder<N>;
9
+ textarea: <N extends string>(name: N) => TextAreaFieldBuilder<N>;
10
+ number: <N extends string>(name: N) => NumberFieldBuilder<N>;
11
+ boolean: <N extends string>(name: N) => BooleanFieldBuilder<N>;
12
+ date: <N extends string>(name: N) => DateFieldBuilder<N>;
13
+ select: <N extends string>(name: N) => SelectFieldBuilder<N>;
14
+ radio: <N extends string>(name: N) => RadioFieldBuilder<N>;
15
+ richText: <N extends string>(name: N) => RichTextFieldBuilder<N>;
16
+ relationship: <N extends string>(name: N) => RelationshipFieldBuilder<N>;
17
+ join: <N extends string>(name: N) => JoinFieldBuilder<N>;
18
+ file: <N extends string>(name: N) => FileFieldBuilder<N>;
19
+ array: <N extends string>(name: N) => ArrayFieldBuilder<N, any[]>;
20
+ group: <N extends string, TSub extends readonly FieldBuilder<any, any, any, any>[]>(name: N, fields?: TSub) => GroupFieldBuilder<N, any, TSub>;
21
+ tabs: () => TabsFieldBuilder<[]>;
22
+ collapsible: <N extends string, S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => CollapsibleFieldBuilder<ExtractNames<S>, S>;
23
+ row: <S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => RowFieldBuilder<S>;
24
+ blocks: <N extends string, TSub extends readonly BlockBuilder<any, any, any>[]>(name: N, ...blocks: TSub) => BlocksFieldBuilder<N, TSub>;
25
+ block: <N extends string>(slug: N) => BlockBuilder<N, string, any[]>;
26
+ };
2
27
  export declare class TextFieldBuilder<TName extends string> extends FieldBuilder<"text", TName, string> {
3
28
  constructor(name: TName);
4
29
  }
@@ -98,28 +123,4 @@ export declare class BlocksFieldBuilder<TName extends string, TBlocks extends re
98
123
  constructor(name: TName);
99
124
  blocks<NewBlocks extends readonly BlockBuilder<any, any, any>[]>(...blocks: NewBlocks): BlocksFieldBuilder<TName, NewBlocks>;
100
125
  }
101
- /**
102
- * The Field Factory object containing methods to instantiate specific field builders.
103
- */
104
- export declare const Field: {
105
- text: <N extends string>(name: N) => TextFieldBuilder<N>;
106
- slug: <N extends string>(name: N) => SlugFieldBuilder<N>;
107
- textarea: <N extends string>(name: N) => TextAreaFieldBuilder<N>;
108
- number: <N extends string>(name: N) => NumberFieldBuilder<N>;
109
- boolean: <N extends string>(name: N) => BooleanFieldBuilder<N>;
110
- date: <N extends string>(name: N) => DateFieldBuilder<N>;
111
- select: <N extends string>(name: N) => SelectFieldBuilder<N>;
112
- radio: <N extends string>(name: N) => RadioFieldBuilder<N>;
113
- richText: <N extends string>(name: N) => RichTextFieldBuilder<N>;
114
- relationship: <N extends string>(name: N) => RelationshipFieldBuilder<N>;
115
- join: <N extends string>(name: N) => JoinFieldBuilder<N>;
116
- file: <N extends string>(name: N) => FileFieldBuilder<N>;
117
- array: <N extends string>(name: N) => ArrayFieldBuilder<N, any[]>;
118
- group: <N extends string, TSub extends readonly FieldBuilder<any, any, any, any>[]>(name: N, fields?: TSub) => GroupFieldBuilder<N, any, TSub>;
119
- tabs: () => TabsFieldBuilder<[]>;
120
- collapsible: <N extends string, S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => CollapsibleFieldBuilder<ExtractNames<S>, S>;
121
- row: <S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => RowFieldBuilder<S>;
122
- blocks: <N extends string, TSub extends readonly BlockBuilder<any, any, any>[]>(name: N, ...blocks: TSub) => BlocksFieldBuilder<N, TSub>;
123
- block: <N extends string>(slug: N) => BlockBuilder<N, string, any[]>;
124
- };
125
126
  export * from "./base";
@@ -2,6 +2,12 @@ import type { AccessConfig, Global as GlobalType, IconName } from "../types";
2
2
  import { type FieldBuilder } from "./fields/base";
3
3
  import type { InferFields } from "./infer";
4
4
  export type Global = GlobalType;
5
+ /**
6
+ * Singleton factory for creating Globals.
7
+ */
8
+ export declare const Global: {
9
+ create: (slug: string) => GlobalBuilder<{}>;
10
+ };
5
11
  /**
6
12
  * A Fluent API Builder for defining OpacaCMS Globals.
7
13
  */
@@ -74,9 +80,3 @@ export declare class GlobalBuilder<TFields extends Record<string, any> = {}> {
74
80
  */
75
81
  build(): Global;
76
82
  }
77
- /**
78
- * Singleton factory for creating Globals.
79
- */
80
- export declare const Global: {
81
- create: (slug: string) => GlobalBuilder<{}>;
82
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opacacms",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "build": "bun run ../../scripts/build.ts && tsc --emitDeclarationOnly",