Skip to content

Commit d9187d4

Browse files
authored
Merge pull request #4 from fossuok/dev
update for post summit meetup
2 parents c007d0c + f02c9b4 commit d9187d4

File tree

14 files changed

+8072
-6207
lines changed

14 files changed

+8072
-6207
lines changed

Diff for: .astro/astro/content.d.ts

+260
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
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+
}>;
8+
}
9+
}
10+
11+
declare module 'astro:content' {
12+
interface RenderResult {
13+
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
14+
headings: import('astro').MarkdownHeading[];
15+
remarkPluginFrontmatter: Record<string, any>;
16+
}
17+
interface Render {
18+
'.md': Promise<RenderResult>;
19+
}
20+
21+
export interface RenderedContent {
22+
html: string;
23+
metadata?: {
24+
imagePaths: Array<string>;
25+
[key: string]: unknown;
26+
};
27+
}
28+
}
29+
30+
declare module 'astro:content' {
31+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
32+
33+
export type CollectionKey = keyof AnyEntryMap;
34+
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
35+
36+
export type ContentCollectionKey = keyof ContentEntryMap;
37+
export type DataCollectionKey = keyof DataEntryMap;
38+
39+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
40+
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
41+
ContentEntryMap[C]
42+
>['slug'];
43+
44+
/** @deprecated Use `getEntry` instead. */
45+
export function getEntryBySlug<
46+
C extends keyof ContentEntryMap,
47+
E extends ValidContentEntrySlug<C> | (string & {}),
48+
>(
49+
collection: C,
50+
// Note that this has to accept a regular string too, for SSR
51+
entrySlug: E,
52+
): E extends ValidContentEntrySlug<C>
53+
? Promise<CollectionEntry<C>>
54+
: Promise<CollectionEntry<C> | undefined>;
55+
56+
/** @deprecated Use `getEntry` instead. */
57+
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
58+
collection: C,
59+
entryId: E,
60+
): Promise<CollectionEntry<C>>;
61+
62+
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
63+
collection: C,
64+
filter?: (entry: CollectionEntry<C>) => entry is E,
65+
): Promise<E[]>;
66+
export function getCollection<C extends keyof AnyEntryMap>(
67+
collection: C,
68+
filter?: (entry: CollectionEntry<C>) => unknown,
69+
): Promise<CollectionEntry<C>[]>;
70+
71+
export function getEntry<
72+
C extends keyof ContentEntryMap,
73+
E extends ValidContentEntrySlug<C> | (string & {}),
74+
>(entry: {
75+
collection: C;
76+
slug: E;
77+
}): E extends ValidContentEntrySlug<C>
78+
? Promise<CollectionEntry<C>>
79+
: Promise<CollectionEntry<C> | undefined>;
80+
export function getEntry<
81+
C extends keyof DataEntryMap,
82+
E extends keyof DataEntryMap[C] | (string & {}),
83+
>(entry: {
84+
collection: C;
85+
id: E;
86+
}): E extends keyof DataEntryMap[C]
87+
? Promise<DataEntryMap[C][E]>
88+
: Promise<CollectionEntry<C> | undefined>;
89+
export function getEntry<
90+
C extends keyof ContentEntryMap,
91+
E extends ValidContentEntrySlug<C> | (string & {}),
92+
>(
93+
collection: C,
94+
slug: E,
95+
): E extends ValidContentEntrySlug<C>
96+
? Promise<CollectionEntry<C>>
97+
: Promise<CollectionEntry<C> | undefined>;
98+
export function getEntry<
99+
C extends keyof DataEntryMap,
100+
E extends keyof DataEntryMap[C] | (string & {}),
101+
>(
102+
collection: C,
103+
id: E,
104+
): E extends keyof DataEntryMap[C]
105+
? Promise<DataEntryMap[C][E]>
106+
: Promise<CollectionEntry<C> | undefined>;
107+
108+
/** Resolve an array of entry references from the same collection */
109+
export function getEntries<C extends keyof ContentEntryMap>(
110+
entries: {
111+
collection: C;
112+
slug: ValidContentEntrySlug<C>;
113+
}[],
114+
): Promise<CollectionEntry<C>[]>;
115+
export function getEntries<C extends keyof DataEntryMap>(
116+
entries: {
117+
collection: C;
118+
id: keyof DataEntryMap[C];
119+
}[],
120+
): Promise<CollectionEntry<C>[]>;
121+
122+
export function render<C extends keyof AnyEntryMap>(
123+
entry: AnyEntryMap[C][string],
124+
): Promise<RenderResult>;
125+
126+
export function reference<C extends keyof AnyEntryMap>(
127+
collection: C,
128+
): import('astro/zod').ZodEffects<
129+
import('astro/zod').ZodString,
130+
C extends keyof ContentEntryMap
131+
? {
132+
collection: C;
133+
slug: ValidContentEntrySlug<C>;
134+
}
135+
: {
136+
collection: C;
137+
id: keyof DataEntryMap[C];
138+
}
139+
>;
140+
// Allow generic `string` to avoid excessive type errors in the config
141+
// if `dev` is not running to update as you edit.
142+
// Invalid collection names will be caught at build time.
143+
export function reference<C extends string>(
144+
collection: C,
145+
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
146+
147+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
148+
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
149+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
150+
>;
151+
152+
type ContentEntryMap = {
153+
"blog": {
154+
"words-as-vectors.mdx": {
155+
id: "words-as-vectors.mdx";
156+
slug: "words-vectors-sparse-vectors-dense-vectors";
157+
body: string;
158+
collection: "blog";
159+
data: InferEntrySchema<"blog">
160+
} & { render(): Render[".mdx"] };
161+
};
162+
"events": {
163+
"hello-foss.md": {
164+
id: "hello-foss.md";
165+
slug: "hello-foss-2023";
166+
body: string;
167+
collection: "events";
168+
data: InferEntrySchema<"events">
169+
} & { render(): Render[".md"] };
170+
"oss24_post_summit_meetup.md": {
171+
id: "oss24_post_summit_meetup.md";
172+
slug: "oss24-post-summit-meetup";
173+
body: string;
174+
collection: "events";
175+
data: InferEntrySchema<"events">
176+
} & { render(): Render[".md"] };
177+
"oss24_workshop1.md": {
178+
id: "oss24_workshop1.md";
179+
slug: "oss24-devops-101-workshop";
180+
body: string;
181+
collection: "events";
182+
data: InferEntrySchema<"events">
183+
} & { render(): Render[".md"] };
184+
"oss24_workshop2.md": {
185+
id: "oss24_workshop2.md";
186+
slug: "oss24_workshop2";
187+
body: string;
188+
collection: "events";
189+
data: InferEntrySchema<"events">
190+
} & { render(): Render[".md"] };
191+
"oss24_workshop3.md": {
192+
id: "oss24_workshop3.md";
193+
slug: "oss24_workshop3";
194+
body: string;
195+
collection: "events";
196+
data: InferEntrySchema<"events">
197+
} & { render(): Render[".md"] };
198+
"oss24_workshop4.md": {
199+
id: "oss24_workshop4.md";
200+
slug: "oss24_workshop4";
201+
body: string;
202+
collection: "events";
203+
data: InferEntrySchema<"events">
204+
} & { render(): Render[".md"] };
205+
"oss24_workshop5.md": {
206+
id: "oss24_workshop5.md";
207+
slug: "oss24_workshop5";
208+
body: string;
209+
collection: "events";
210+
data: InferEntrySchema<"events">
211+
} & { render(): Render[".md"] };
212+
"oss24_workshop6.md": {
213+
id: "oss24_workshop6.md";
214+
slug: "oss24_workshop6";
215+
body: string;
216+
collection: "events";
217+
data: InferEntrySchema<"events">
218+
} & { render(): Render[".md"] };
219+
"streamline_git_worksflows.md": {
220+
id: "streamline_git_worksflows.md";
221+
slug: "streamline_git_worksflows";
222+
body: string;
223+
collection: "events";
224+
data: InferEntrySchema<"events">
225+
} & { render(): Render[".md"] };
226+
"webdev101.md": {
227+
id: "webdev101.md";
228+
slug: "webdev101";
229+
body: string;
230+
collection: "events";
231+
data: InferEntrySchema<"events">
232+
} & { render(): Render[".md"] };
233+
};
234+
"static": {
235+
"code-of-conduct.md": {
236+
id: "code-of-conduct.md";
237+
slug: "code-of-conduct";
238+
body: string;
239+
collection: "static";
240+
data: InferEntrySchema<"static">
241+
} & { render(): Render[".md"] };
242+
"sponsorship.md": {
243+
id: "sponsorship.md";
244+
slug: "sponsorship";
245+
body: string;
246+
collection: "static";
247+
data: InferEntrySchema<"static">
248+
} & { render(): Render[".md"] };
249+
};
250+
251+
};
252+
253+
type DataEntryMap = {
254+
255+
};
256+
257+
type AnyEntryMap = ContentEntryMap & DataEntryMap;
258+
259+
export type ContentConfig = typeof import("../../src/content/config.js");
260+
}

Diff for: .astro/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"_variables": {
3+
"lastUpdateCheck": 1726680003099
4+
}
5+
}

0 commit comments

Comments
 (0)