@stacksjs/types 0.53.1 → 0.56.21

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 (47) hide show
  1. package/dist/cli.mjs +5 -3
  2. package/dist/cron-jobs.mjs +12 -0
  3. package/dist/errors.mjs +7 -1
  4. package/dist/index.mjs +2 -1
  5. package/dist/queue.mjs +0 -0
  6. package/package.json +25 -18
  7. package/dist/app.d.ts +0 -108
  8. package/dist/auto-imports.d.ts +0 -1
  9. package/dist/build.d.ts +0 -2
  10. package/dist/cache.d.ts +0 -69
  11. package/dist/cdn.d.ts +0 -15
  12. package/dist/cli.d.ts +0 -278
  13. package/dist/components.d.ts +0 -60
  14. package/dist/cron-jobs.d.ts +0 -16
  15. package/dist/database.d.ts +0 -32
  16. package/dist/debug.d.ts +0 -6
  17. package/dist/deploy.d.ts +0 -9
  18. package/dist/dns.d.ts +0 -43
  19. package/dist/docs.d.ts +0 -3
  20. package/dist/errors.d.ts +0 -1
  21. package/dist/events.d.ts +0 -22
  22. package/dist/exit-code.d.ts +0 -10
  23. package/dist/fs.d.ts +0 -27
  24. package/dist/git.d.ts +0 -128
  25. package/dist/hashing.d.ts +0 -102
  26. package/dist/i18n.d.ts +0 -19
  27. package/dist/index.d.ts +0 -39
  28. package/dist/inspect.d.ts +0 -9
  29. package/dist/layout.d.ts +0 -7
  30. package/dist/library.d.ts +0 -132
  31. package/dist/manifest.d.ts +0 -9
  32. package/dist/markdown.d.ts +0 -167
  33. package/dist/model.d.ts +0 -40
  34. package/dist/notifications.d.ts +0 -164
  35. package/dist/pages.d.ts +0 -10
  36. package/dist/payments.d.ts +0 -59
  37. package/dist/promise.d.ts +0 -1
  38. package/dist/pwa.d.ts +0 -7
  39. package/dist/reactivity.d.ts +0 -1
  40. package/dist/router.d.ts +0 -42
  41. package/dist/search-engine.d.ts +0 -143
  42. package/dist/ssg.d.ts +0 -2
  43. package/dist/stacks.d.ts +0 -163
  44. package/dist/tables.d.ts +0 -52
  45. package/dist/ui.d.ts +0 -180
  46. package/dist/utils.d.ts +0 -30
  47. /package/dist/{markdown.mjs → money.mjs} +0 -0
@@ -1,143 +0,0 @@
1
- import type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, DocumentOptions as RecordOptions, Settings as SearchIndexSettings, SearchParams, SearchResponse } from 'meilisearch';
2
- import type { MaybePromise } from '.';
3
- type Search = any;
4
- type Page = any;
5
- type Pages = Page[];
6
- type Filter = any;
7
- type Filters = Filter[];
8
- type Result = any;
9
- type Results = Result[];
10
- type SearchFilter = any;
11
- type SearchFilters = SearchFilter[];
12
- type Sorts = any;
13
- type Sort = any;
14
- export interface SearchEngineOptions {
15
- /**
16
- * **Search Engine Driver**
17
- *
18
- * The search engine to utilize.
19
- *
20
- * @default string 'meilisearch'
21
- * @see https://stacksjs.dev/docs/search-engine
22
- */
23
- driver: 'meilisearch' | 'algolia';
24
- meilisearch?: {
25
- host: string;
26
- apiKey: string;
27
- };
28
- }
29
- export interface ServicesOptions {
30
- algolia?: {
31
- appId: string;
32
- apiKey: string;
33
- };
34
- meilisearch?: {
35
- appId: string;
36
- apiKey: string;
37
- };
38
- stripe?: {
39
- appId: string;
40
- apiKey: string;
41
- };
42
- planetscale?: {
43
- appId: string;
44
- apiKey: string;
45
- };
46
- supabase?: {
47
- appId: string;
48
- apiKey: string;
49
- };
50
- aws?: {
51
- appId: string;
52
- apiKey: string;
53
- };
54
- novu?: {
55
- key: string;
56
- };
57
- }
58
- export interface StorageOptions {
59
- /**
60
- * **Storage Driver**
61
- *
62
- * The storage driver to utilize.
63
- *
64
- * @default string 's3'
65
- * @see https://stacksjs.dev/docs/storage
66
- */
67
- driver: 's3' | 'local';
68
- }
69
- export interface MeiliSearchOptions {
70
- apiKey: string;
71
- host: string;
72
- }
73
- export interface SearchEngineDriver {
74
- client: MeiliSearch;
75
- createIndex: (name: string, options?: IndexOptions) => MaybePromise<EnqueuedTask>;
76
- getIndex: (name: string) => MaybePromise<Index>;
77
- updateIndex?: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>;
78
- deleteIndex?: (name: string) => MaybePromise<EnqueuedTask>;
79
- updateIndexSettings: (name: string, settings: SearchIndexSettings) => MaybePromise<EnqueuedTask>;
80
- listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>;
81
- listAllIndices: () => MaybePromise<IndexesResults<Index[]>>;
82
- getRecord?: (key: string) => MaybePromise<any>;
83
- getRecords?: (key: string) => MaybePromise<RecordOptions>;
84
- createRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
85
- createRecords?: (records: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
86
- createOrReplaceRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
87
- createOrUpdateRecord?: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
88
- deleteRecord?: (recordId: string | number, indexName: string) => MaybePromise<EnqueuedTask>;
89
- deleteAllRecords?: (indexName: string) => MaybePromise<EnqueuedTask>;
90
- batchDeleteRecords?: (recordIds: string[] | number[], indexName: string) => MaybePromise<EnqueuedTask>;
91
- search?: (query: string, indexName: string, options: SearchParams) => MaybePromise<Search>;
92
- calculatePagination: Pages;
93
- currentPage: Page;
94
- filterName: string;
95
- filters: Filters;
96
- goToNextPage: () => Page;
97
- goToPage: (pageNumber: number) => Page;
98
- goToPrevPage: () => Page;
99
- hits: Hits;
100
- index: Index;
101
- lastPage: Page;
102
- perPage: number;
103
- query: string;
104
- results: Results;
105
- searchFilters: SearchFilters;
106
- searchParams: SearchParams;
107
- setTotalHits: number;
108
- sort: Sort;
109
- sorts: Sorts;
110
- totalPages: number;
111
- }
112
- export type SearchEngineDriverFactory<T> = (opts?: T) => SearchEngineDriver;
113
- /**
114
- * This interface is used to unify the persisting of data to localStorage
115
- */
116
- export interface SearchEngineStorage {
117
- /**
118
- * The search engine index name.
119
- * i.e. the type of table, like `users`, `posts`, `products`, etc.
120
- */
121
- index?: string;
122
- /**
123
- * The search engine results object.
124
- */
125
- results?: SearchResponse;
126
- /**
127
- * The search engine hits object.
128
- */
129
- hits?: Hits;
130
- /**
131
- * The number of hits to be returned per page.
132
- *
133
- * @default number 20
134
- */
135
- perPage: number;
136
- /**
137
- * The current page number.
138
- *
139
- * @default number 1
140
- */
141
- currentPage: number;
142
- }
143
- export type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, RecordOptions, SearchIndexSettings, SearchParams, SearchResponse };
package/dist/ssg.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { type ViteSSGContext } from './';
2
- export type UserModule = (ctx: ViteSSGContext) => void;
package/dist/stacks.d.ts DELETED
@@ -1,163 +0,0 @@
1
- import type { AppOptions, CacheOptions, CdnOptions, DatabaseOptions, DebugOptions, DnsOptions, DocsOptions, EmailOptions, EventOptions, GitOptions, HashingOptions, LibraryOptions, NotificationOptions, PaymentOptions, SearchEngineOptions, ServicesOptions, StorageOptions, UiOptions, UserCliOptions } from './';
2
- /**
3
- * **Stacks Options**
4
- *
5
- * This configuration defines all of your Stacks options. Because Stacks is fully-typed,
6
- * you may hover any of the options below and the definitions will be provided. In case
7
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
8
- */
9
- export interface StacksOptions {
10
- /**
11
- * **Application Options**
12
- *
13
- * This configuration defines all of your Application options. Because Stacks is fully-typed,
14
- * you may hover any of the options below and the definitions will be provided. In case
15
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
16
- */
17
- app: Partial<AppOptions>;
18
- /**
19
- * **Cache Options**
20
- *
21
- * This configuration defines all of your Cache options. Because Stacks is fully-typed, you
22
- * may hover any of the options below and the definitions will be provided. In case you
23
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
24
- */
25
- cache: Partial<CacheOptions>;
26
- /**
27
- * **CDN Options**
28
- *
29
- * This configuration defines all of your CDN options. Because Stacks is fully-typed, you
30
- * may hover any of the options below and the definitions will be provided. In case you
31
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
32
- */
33
- cdn: Partial<CdnOptions>;
34
- /**
35
- * **CLI Options**
36
- *
37
- * This configuration defines all of your CLI options. Because Stacks is fully-typed, you
38
- * may hover any of the options below and the definitions will be provided. In case you
39
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
40
- */
41
- cli: Partial<UserCliOptions>;
42
- /**
43
- * **Database Options**
44
- *
45
- * This configuration defines all of your Database options. Because Stacks is fully-typed, you
46
- * may hover any of the options below and the definitions will be provided. In case you
47
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
48
- */
49
- database: Partial<DatabaseOptions>;
50
- /**
51
- * **Debug Options**
52
- *
53
- * This configuration defines all of your Debug options. Because Stacks is fully-typed, you
54
- * may hover any of the options below and the definitions will be provided. In case you
55
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
56
- */
57
- debug: Partial<DebugOptions>;
58
- /**
59
- * **DNS Options**
60
- *
61
- * This configuration defines all of your DNS options. Because Stacks is fully-typed, you
62
- * may hover any of the options below and the definitions will be provided. In case you
63
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
64
- */
65
- dns: Partial<DnsOptions>;
66
- /**
67
- * **Docs Options**
68
- *
69
- * This configuration defines all of your Docs options. Because Stacks is fully-typed, you
70
- * may hover any of the options below and the definitions will be provided. In case you
71
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
72
- */
73
- docs: Partial<DocsOptions>;
74
- /**
75
- * **Email Options**
76
- *
77
- * This configuration defines all of your Email options. Because Stacks is fully-typed, you
78
- * may hover any of the options below and the definitions will be provided. In case you
79
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
80
- */
81
- email: Partial<EmailOptions>;
82
- /**
83
- * **Event Options**
84
- *
85
- * This configuration defines all of your Event options. Because Stacks is fully-typed, you
86
- * may hover any of the options below and the definitions will be provided. In case you
87
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
88
- */
89
- event: Partial<EventOptions>;
90
- /**
91
- * **Git Options**
92
- *
93
- * This configuration defines all of your Git options. Because Stacks is fully-typed, you
94
- * may hover any of the options below and the definitions will be provided. In case you
95
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
96
- */
97
- git: Partial<GitOptions>;
98
- /**
99
- * **Hashing Options**
100
- *
101
- * This configuration defines all of your Hashing options. Because Stacks is fully-typed, you
102
- * may hover any of the options below and the definitions will be provided. In case you
103
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
104
- */
105
- hashing: Partial<HashingOptions>;
106
- /**
107
- * **Library Options**
108
- *
109
- * This configuration defines all of your Library options. Because Stacks is fully-typed, you
110
- * may hover any of the options below and the definitions will be provided. In case you
111
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
112
- */
113
- library: Partial<LibraryOptions>;
114
- /**
115
- * **Notification Options**
116
- *
117
- * This configuration defines all of your Notification options. Because Stacks is fully-typed,
118
- * you may hover any of the options below and the definitions will be provided. In case
119
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
120
- */
121
- notification: Partial<NotificationOptions>;
122
- /**
123
- * **Payment Options**
124
- *
125
- * This configuration defines all of your Payment options. Because Stacks is fully-typed,
126
- * you may hover any of the options below and the definitions will be provided. In case
127
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
128
- */
129
- payment: Partial<PaymentOptions>;
130
- /**
131
- * **Search Engine Options**
132
- *
133
- * This configuration defines all of your Search Engine options. Because Stacks is fully-typed,
134
- * you may hover any of the options below and the definitions will be provided. In case
135
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
136
- */
137
- searchEngine: Partial<SearchEngineOptions>;
138
- /**
139
- * **Services Options**
140
- *
141
- * This configuration defines all of your Services options. Because Stacks is fully-typed,
142
- * you may hover any of the options below and the definitions will be provided. In case
143
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
144
- */
145
- services: Partial<ServicesOptions>;
146
- /**
147
- * **Storage Options**
148
- *
149
- * This configuration defines all of your Storage options. Because Stacks is fully-typed,
150
- * you may hover any of the options below and the definitions will be provided. In case
151
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
152
- */
153
- storage: Partial<StorageOptions>;
154
- /**
155
- * **UI Options**
156
- *
157
- * This configuration defines all of your UI options. Because Stacks is fully-typed, you
158
- * may hover any of the options below and the definitions will be provided. In case you
159
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
160
- */
161
- ui: Partial<UiOptions>;
162
- }
163
- export type ResolvedStacksOptions = Required<StacksOptions>;
package/dist/tables.d.ts DELETED
@@ -1,52 +0,0 @@
1
- import type { Hits, SearchResponse } from 'meilisearch';
2
- /**
3
- * the TableStore interface is primarily used to unify the persisting of data to localStorage
4
- */
5
- export interface TableStore {
6
- /**
7
- * The search engine index name.
8
- * i.e. the type of table, like `users`, `posts`, `products`, etc.
9
- */
10
- index: string;
11
- /**
12
- * The search engine results object.
13
- */
14
- results?: SearchResponse<Record<string, any>>;
15
- /**
16
- * The search engine hits object.
17
- */
18
- hits?: Hits;
19
- columns: string[];
20
- source?: string;
21
- password?: string;
22
- searchable?: string | boolean;
23
- query?: string;
24
- sortable?: string | boolean;
25
- sort?: string;
26
- sorts?: string | string[];
27
- filterable?: string | boolean;
28
- filters?: string | string[];
29
- filterValue?: any[];
30
- actionable?: string | boolean;
31
- actions?: string | string[];
32
- perPage: number;
33
- selectable?: string | boolean;
34
- selectedRows?: number[] | string[];
35
- selectedAll?: boolean;
36
- goToNextPage: number;
37
- goToPage: number;
38
- goToPrevPage: number;
39
- lastPageNumber: number;
40
- searchFilters?: object;
41
- searchParams?: object;
42
- setTotalHits: number;
43
- /**
44
- *
45
- * The current page number
46
- * @default 1
47
- * @type {number}
48
- * @memberof TableStore
49
- * @example 1
50
- */
51
- currentPage: number;
52
- }
package/dist/ui.d.ts DELETED
@@ -1,180 +0,0 @@
1
- import type { UserShortcuts } from 'unocss';
2
- export type Font = 'inter' | 'mona' | 'hubot';
3
- export type Icon = 'heroicon-outline' | 'heroicon-solid';
4
- export type WebFontsProviders = 'google' | 'bunny' | 'fontshare';
5
- export interface FontInfo {
6
- title: string;
7
- text: string;
8
- }
9
- export type FontFor = 'email' | 'desktop' | 'mobile' | 'web';
10
- export interface WebFontMeta {
11
- name: string;
12
- weights?: (string | number)[];
13
- italic?: boolean;
14
- provider?: WebFontsProviders;
15
- }
16
- /**
17
- * **UI Engine Options**
18
- *
19
- * This type defines all of your UI Engine options. Because Stacks is fully-typed, you may
20
- * hover any of the options below and the definitions will be provided. In case you
21
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
22
- */
23
- export interface UiOptions {
24
- /**
25
- * **Shortcuts**
26
- *
27
- * Shortcuts provide you with the ability to combine
28
- * utility names for reusability purposes.
29
- *
30
- * @example
31
- * ```
32
- * shortcuts: {
33
- * 'btn': 'px-4 py-2 rounded text-white bg-blue-500',
34
- * 'btn-lg': 'btn px-6 py-3',
35
- * }
36
- * ```
37
- */
38
- shortcuts: Shortcuts;
39
- /**
40
- * **Safelist**
41
- *
42
- * Use the `safelist` option to ensure the generation of
43
- * those utility classes. This is useful when certain
44
- * class names don’t exist in your content files.
45
- *
46
- * @example
47
- * ```ts
48
- * safelist: [
49
- * 'btn',
50
- * 'btn-lg',
51
- * 'btn-blue',
52
- * 'btn-blue-500',
53
- * ]
54
- */
55
- safelist: string;
56
- /**
57
- * **Trigger String**
58
- *
59
- * The "trigger string" defines the class name markup
60
- * you want to add into your components.
61
- *
62
- * @default ':stx:'
63
- *
64
- * @example
65
- * ```ts
66
- * trigger: ':stx:'
67
- * ```
68
- */
69
- trigger?: string;
70
- /**
71
- * **Class Prefix**
72
- *
73
- * The prefix for the compiled class name. When transforming
74
- * all utility classes into a single class, this prefix
75
- * will be added to the generated CSS class name.
76
- *
77
- * @default 'stx-'
78
- *
79
- * @example
80
- * ```ts
81
- * prefix: 'stx-'
82
- * ```
83
- */
84
- classPrefix?: string;
85
- /**
86
- * **Hash Function**
87
- *
88
- * The hash function used to generate the class name.
89
- *
90
- * @example
91
- * ```ts
92
- * hash: (str: string) => {
93
- * return str
94
- * .split('')
95
- * .reduce((a, b) => {
96
- * a = ((a << 5) - a) + b.charCodeAt(0)
97
- * return a & a
98
- * }, 0)
99
- * .toString(36)
100
- * }
101
- */
102
- hashFn?: (str: string) => string;
103
- /**
104
- * **CSS Resets—Preset**
105
- *
106
- * Define a standard of reset CSS stylesheets. By default, the Tailwind
107
- * reset styles are utilized. You may set this value to `null`
108
- * if you prefer not applying any default stylesheets.
109
- *
110
- * @url https://www.npmjs.com/package/@unocss/reset
111
- * @todo preset needs to be added via a Vite plugin on development & build
112
- * @example
113
- * ```ts
114
- * reset: 'tailwind'
115
- * ```
116
- */
117
- reset?: ResetPreset;
118
- /**
119
- * **Fonts**
120
- *
121
- * Define the fonts you want to use. By default, Stacks provides support
122
- * for several local font providers. You may set this value to
123
- * `null` if you prefer not utilize any local fonts.
124
- *
125
- * @see https://stacks.ow3.org/fonts
126
- * @example applies the same font for all platforms _(web, email, desktop, and mobile)_
127
- * ```ts
128
- * fonts: {
129
- * title: 'Mona',
130
- * text: 'Hubot'
131
- * }
132
- * ```
133
- * @example
134
- * ```ts
135
- * fonts: {
136
- * web: {
137
- * title: 'Inter',
138
- * text: 'Mona'
139
- * },
140
- * desktop: {
141
- * title: 'Mona',
142
- * text: 'Inter'
143
- * },
144
- * }
145
- * ```
146
- */
147
- fonts?: Record<FontFor, FontInfo> | {
148
- [key in FontFor]: FontInfo;
149
- };
150
- useWebFonts?: boolean | WebFontsProviders;
151
- /**
152
- * **Icon Sets**
153
- *
154
- * This value defines the icon sets you want to use. When using icons, they
155
- * are displayed utilizing a technique called "icons in pure css."
156
- * Learn more here https://antfu.me/posts/icons-in-pure-css.
157
- *
158
- * @see https://stacks.ow3.org/config/icons — list of available icon sets
159
- * @todo implement this into Vite build flow
160
- * @example
161
- * ```ts
162
- * icons: ['heroicons']
163
- * ```
164
- * @example
165
- * ```html
166
- * <i class="i-heroicons-outline-book-open w-8 h-8 text-gray-500" aria-hidden="true" />
167
- * ```
168
- */
169
- icons: Icon | Icon[];
170
- }
171
- export type Shortcuts = UserShortcuts;
172
- /**
173
- * **Style Reset — Preset**
174
- *
175
- * This value sets the "reset preset." A preset defines certain
176
- * CSS defaults to be applied.
177
- *
178
- * @default "tailwind"
179
- */
180
- export type ResetPreset = 'tailwind' | 'normalize' | 'sanitize' | 'eric-meyer' | 'antfu' | null;
package/dist/utils.d.ts DELETED
@@ -1,30 +0,0 @@
1
- /**
2
- * Null or whatever.
3
- */
4
- export type Nullable<T> = T | null | undefined;
5
- /**
6
- * Function
7
- */
8
- export type Fn<T = void> = () => T;
9
- /**
10
- * Array, or not yet
11
- */
12
- export type Arrayable<T> = T | Array<T>;
13
- /**
14
- * Constructor.
15
- */
16
- export type Constructor<T = void> = new (...args: any[]) => T;
17
- /**
18
- * Defines an intersection type of all union items.
19
- *
20
- * @param U Union of any types that will be intersected.
21
- * @returns U items intersected
22
- * @see https://stackoverflow.com/a/50375286/9259330
23
- */
24
- export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
25
- export type MergeInsertions<T> = T extends object ? {
26
- [K in keyof T]: MergeInsertions<T[K]>;
27
- } : T;
28
- export type DeepMerge<F, S> = MergeInsertions<{
29
- [K in keyof F | keyof S]: K extends keyof S & keyof F ? DeepMerge<F[K], S[K]> : K extends keyof S ? S[K] : K extends keyof F ? F[K] : never;
30
- }>;
File without changes