spoko-design-system 0.2.86 → 0.2.88

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.
@@ -0,0 +1,167 @@
1
+ declare module 'astro:content' {
2
+ interface Render {
3
+ '.mdx': Promise<{
4
+ Content: import('astro').MarkdownInstance<{}>['Content'];
5
+ headings: import('astro').MarkdownHeading[];
6
+ remarkPluginFrontmatter: Record<string, any>;
7
+ components: import('astro').MDXInstance<{}>['components'];
8
+ }>;
9
+ }
10
+ }
11
+
12
+ declare module 'astro:content' {
13
+ export interface RenderResult {
14
+ Content: import('astro/runtime/server/index.js').AstroComponentFactory;
15
+ headings: import('astro').MarkdownHeading[];
16
+ remarkPluginFrontmatter: Record<string, any>;
17
+ }
18
+ interface Render {
19
+ '.md': Promise<RenderResult>;
20
+ }
21
+
22
+ export interface RenderedContent {
23
+ html: string;
24
+ metadata?: {
25
+ imagePaths: Array<string>;
26
+ [key: string]: unknown;
27
+ };
28
+ }
29
+ }
30
+
31
+ declare module 'astro:content' {
32
+ type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
33
+
34
+ export type CollectionKey = keyof AnyEntryMap;
35
+ export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
36
+
37
+ export type ContentCollectionKey = keyof ContentEntryMap;
38
+ export type DataCollectionKey = keyof DataEntryMap;
39
+
40
+ type AllValuesOf<T> = T extends any ? T[keyof T] : never;
41
+ type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
42
+ ContentEntryMap[C]
43
+ >['slug'];
44
+
45
+ export type ReferenceDataEntry<
46
+ C extends CollectionKey,
47
+ E extends keyof DataEntryMap[C] = string,
48
+ > = {
49
+ collection: C;
50
+ id: E;
51
+ };
52
+ export type ReferenceContentEntry<
53
+ C extends keyof ContentEntryMap,
54
+ E extends ValidContentEntrySlug<C> | (string & {}) = string,
55
+ > = {
56
+ collection: C;
57
+ slug: E;
58
+ };
59
+
60
+ /** @deprecated Use `getEntry` instead. */
61
+ export function getEntryBySlug<
62
+ C extends keyof ContentEntryMap,
63
+ E extends ValidContentEntrySlug<C> | (string & {}),
64
+ >(
65
+ collection: C,
66
+ // Note that this has to accept a regular string too, for SSR
67
+ entrySlug: E,
68
+ ): E extends ValidContentEntrySlug<C>
69
+ ? Promise<CollectionEntry<C>>
70
+ : Promise<CollectionEntry<C> | undefined>;
71
+
72
+ /** @deprecated Use `getEntry` instead. */
73
+ export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
74
+ collection: C,
75
+ entryId: E,
76
+ ): Promise<CollectionEntry<C>>;
77
+
78
+ export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
79
+ collection: C,
80
+ filter?: (entry: CollectionEntry<C>) => entry is E,
81
+ ): Promise<E[]>;
82
+ export function getCollection<C extends keyof AnyEntryMap>(
83
+ collection: C,
84
+ filter?: (entry: CollectionEntry<C>) => unknown,
85
+ ): Promise<CollectionEntry<C>[]>;
86
+
87
+ export function getEntry<
88
+ C extends keyof ContentEntryMap,
89
+ E extends ValidContentEntrySlug<C> | (string & {}),
90
+ >(
91
+ entry: ReferenceContentEntry<C, E>,
92
+ ): E extends ValidContentEntrySlug<C>
93
+ ? Promise<CollectionEntry<C>>
94
+ : Promise<CollectionEntry<C> | undefined>;
95
+ export function getEntry<
96
+ C extends keyof DataEntryMap,
97
+ E extends keyof DataEntryMap[C] | (string & {}),
98
+ >(
99
+ entry: ReferenceDataEntry<C, E>,
100
+ ): E extends keyof DataEntryMap[C]
101
+ ? Promise<DataEntryMap[C][E]>
102
+ : Promise<CollectionEntry<C> | undefined>;
103
+ export function getEntry<
104
+ C extends keyof ContentEntryMap,
105
+ E extends ValidContentEntrySlug<C> | (string & {}),
106
+ >(
107
+ collection: C,
108
+ slug: E,
109
+ ): E extends ValidContentEntrySlug<C>
110
+ ? Promise<CollectionEntry<C>>
111
+ : Promise<CollectionEntry<C> | undefined>;
112
+ export function getEntry<
113
+ C extends keyof DataEntryMap,
114
+ E extends keyof DataEntryMap[C] | (string & {}),
115
+ >(
116
+ collection: C,
117
+ id: E,
118
+ ): E extends keyof DataEntryMap[C]
119
+ ? string extends keyof DataEntryMap[C]
120
+ ? Promise<DataEntryMap[C][E]> | undefined
121
+ : Promise<DataEntryMap[C][E]>
122
+ : Promise<CollectionEntry<C> | undefined>;
123
+
124
+ /** Resolve an array of entry references from the same collection */
125
+ export function getEntries<C extends keyof ContentEntryMap>(
126
+ entries: ReferenceContentEntry<C, ValidContentEntrySlug<C>>[],
127
+ ): Promise<CollectionEntry<C>[]>;
128
+ export function getEntries<C extends keyof DataEntryMap>(
129
+ entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
130
+ ): Promise<CollectionEntry<C>[]>;
131
+
132
+ export function render<C extends keyof AnyEntryMap>(
133
+ entry: AnyEntryMap[C][string],
134
+ ): Promise<RenderResult>;
135
+
136
+ export function reference<C extends keyof AnyEntryMap>(
137
+ collection: C,
138
+ ): import('astro/zod').ZodEffects<
139
+ import('astro/zod').ZodString,
140
+ C extends keyof ContentEntryMap
141
+ ? ReferenceContentEntry<C, ValidContentEntrySlug<C>>
142
+ : ReferenceDataEntry<C, keyof DataEntryMap[C]>
143
+ >;
144
+ // Allow generic `string` to avoid excessive type errors in the config
145
+ // if `dev` is not running to update as you edit.
146
+ // Invalid collection names will be caught at build time.
147
+ export function reference<C extends string>(
148
+ collection: C,
149
+ ): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
150
+
151
+ type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
152
+ type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
153
+ ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
154
+ >;
155
+
156
+ type ContentEntryMap = {
157
+
158
+ };
159
+
160
+ type DataEntryMap = {
161
+
162
+ };
163
+
164
+ type AnyEntryMap = ContentEntryMap & DataEntryMap;
165
+
166
+ export type ContentConfig = typeof import("./../src/content.config.mjs");
167
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.2.86",
3
+ "version": "0.2.88",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -11,7 +11,8 @@
11
11
  "require": "./index.ts"
12
12
  },
13
13
  "./styles/*": "./src/styles/*",
14
- "./icons": "./icon.config.ts"
14
+ "./icons": "./icon.config.ts",
15
+ "./uno-config": "./src/uno-config/index.ts"
15
16
  },
16
17
  "scripts": {
17
18
  "dev": "astro dev",
package/uno.config.ts CHANGED
@@ -1,4 +1,3 @@
1
- // uno.config.ts w projekcie
2
- import { createSdsConfig } from 'uno-config';
1
+ import { createSdsConfig } from './uno-config';
3
2
 
4
3
  export default createSdsConfig();
File without changes
File without changes
File without changes
File without changes
File without changes