[ci] format
This commit is contained in:
parent
0be2d0dbc2
commit
a673239548
6 changed files with 16 additions and 16 deletions
|
@ -42,7 +42,7 @@ export const ALGOLIA = {
|
|||
};
|
||||
|
||||
export type Sidebar = Record<
|
||||
typeof KNOWN_LANGUAGE_CODES[number],
|
||||
(typeof KNOWN_LANGUAGE_CODES)[number],
|
||||
Record<string, { text: string; link: string }[]>
|
||||
>;
|
||||
export const SIDEBAR: Sidebar = {
|
||||
|
|
|
@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
|
|||
export function getLanguageFromURL(pathname: string) {
|
||||
const langCodeMatch = pathname.match(langPathRegex);
|
||||
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
|
||||
return langCode as typeof KNOWN_LANGUAGE_CODES[number];
|
||||
return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
declare module 'astro:content' {
|
||||
export { z } from 'astro/zod';
|
||||
export type CollectionEntry<C extends keyof typeof entryMap> =
|
||||
typeof entryMap[C][keyof typeof entryMap[C]] & Render;
|
||||
(typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;
|
||||
|
||||
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
|
||||
schema?: S;
|
||||
|
@ -17,17 +17,17 @@ declare module 'astro:content' {
|
|||
input: BaseCollectionConfig<S>
|
||||
): BaseCollectionConfig<S>;
|
||||
|
||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
|
||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof (typeof entryMap)[C]>(
|
||||
collection: C,
|
||||
entryKey: E
|
||||
): Promise<typeof entryMap[C][E] & Render>;
|
||||
): Promise<(typeof entryMap)[C][E] & Render>;
|
||||
export function getCollection<
|
||||
C extends keyof typeof entryMap,
|
||||
E extends keyof typeof entryMap[C]
|
||||
E extends keyof (typeof entryMap)[C]
|
||||
>(
|
||||
collection: C,
|
||||
filter?: (data: typeof entryMap[C][E]) => boolean
|
||||
): Promise<(typeof entryMap[C][E] & Render)[]>;
|
||||
filter?: (data: (typeof entryMap)[C][E]) => boolean
|
||||
): Promise<((typeof entryMap)[C][E] & Render)[]>;
|
||||
|
||||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
||||
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
|
||||
|
|
|
@ -239,7 +239,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
|
|||
}
|
||||
|
||||
/** Union type of supported markdown file extensions */
|
||||
type MarkdowFileExtension = typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS[number];
|
||||
type MarkdowFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];
|
||||
|
||||
export interface AstroGlobalPartial {
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
declare module 'astro:content' {
|
||||
export { z } from 'astro/zod';
|
||||
export type CollectionEntry<C extends keyof typeof entryMap> =
|
||||
typeof entryMap[C][keyof typeof entryMap[C]] & Render;
|
||||
(typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;
|
||||
|
||||
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
|
||||
schema?: S;
|
||||
|
@ -17,17 +17,17 @@ declare module 'astro:content' {
|
|||
input: BaseCollectionConfig<S>
|
||||
): BaseCollectionConfig<S>;
|
||||
|
||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
|
||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof (typeof entryMap)[C]>(
|
||||
collection: C,
|
||||
entryKey: E
|
||||
): Promise<typeof entryMap[C][E] & Render>;
|
||||
): Promise<(typeof entryMap)[C][E] & Render>;
|
||||
export function getCollection<
|
||||
C extends keyof typeof entryMap,
|
||||
E extends keyof typeof entryMap[C]
|
||||
E extends keyof (typeof entryMap)[C]
|
||||
>(
|
||||
collection: C,
|
||||
filter?: (data: typeof entryMap[C][E]) => boolean
|
||||
): Promise<(typeof entryMap[C][E] & Render)[]>;
|
||||
filter?: (data: (typeof entryMap)[C][E]) => boolean
|
||||
): Promise<((typeof entryMap)[C][E] & Render)[]>;
|
||||
|
||||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
||||
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
|
||||
|
|
|
@ -613,5 +613,5 @@ See https://docs.astro.build/en/guides/server-side-rendering/ for more informati
|
|||
|
||||
type ValueOf<T> = T[keyof T];
|
||||
export type AstroErrorCodes = ValueOf<{
|
||||
[T in keyof typeof AstroErrorData]: typeof AstroErrorData[T]['code'];
|
||||
[T in keyof typeof AstroErrorData]: (typeof AstroErrorData)[T]['code'];
|
||||
}>;
|
||||
|
|
Loading…
Reference in a new issue