[ci] format

This commit is contained in:
bluwy 2023-01-09 07:27:31 +00:00 committed by fredkbot
parent 0be2d0dbc2
commit a673239548
6 changed files with 16 additions and 16 deletions

View file

@ -42,7 +42,7 @@ export const ALGOLIA = {
}; };
export type Sidebar = Record< export type Sidebar = Record<
typeof KNOWN_LANGUAGE_CODES[number], (typeof KNOWN_LANGUAGE_CODES)[number],
Record<string, { text: string; link: string }[]> Record<string, { text: string; link: string }[]>
>; >;
export const SIDEBAR: Sidebar = { export const SIDEBAR: Sidebar = {

View file

@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
export function getLanguageFromURL(pathname: string) { export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(langPathRegex); const langCodeMatch = pathname.match(langPathRegex);
const langCode = langCodeMatch ? langCodeMatch[1] : 'en'; const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
return langCode as typeof KNOWN_LANGUAGE_CODES[number]; return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
} }

View file

@ -1,7 +1,7 @@
declare module 'astro:content' { declare module 'astro:content' {
export { z } from 'astro/zod'; export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> = 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> = { type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
schema?: S; schema?: S;
@ -17,17 +17,17 @@ declare module 'astro:content' {
input: BaseCollectionConfig<S> input: BaseCollectionConfig<S>
): 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, collection: C,
entryKey: E entryKey: E
): Promise<typeof entryMap[C][E] & Render>; ): Promise<(typeof entryMap)[C][E] & Render>;
export function getCollection< export function getCollection<
C extends keyof typeof entryMap, C extends keyof typeof entryMap,
E extends keyof typeof entryMap[C] E extends keyof (typeof entryMap)[C]
>( >(
collection: C, collection: C,
filter?: (data: typeof entryMap[C][E]) => boolean filter?: (data: (typeof entryMap)[C][E]) => boolean
): Promise<(typeof entryMap[C][E] & Render)[]>; ): Promise<((typeof entryMap)[C][E] & Render)[]>;
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer< type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']> import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>

View file

@ -239,7 +239,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
} }
/** Union type of supported markdown file extensions */ /** 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 { export interface AstroGlobalPartial {
/** /**

View file

@ -1,7 +1,7 @@
declare module 'astro:content' { declare module 'astro:content' {
export { z } from 'astro/zod'; export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> = 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> = { type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
schema?: S; schema?: S;
@ -17,17 +17,17 @@ declare module 'astro:content' {
input: BaseCollectionConfig<S> input: BaseCollectionConfig<S>
): 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, collection: C,
entryKey: E entryKey: E
): Promise<typeof entryMap[C][E] & Render>; ): Promise<(typeof entryMap)[C][E] & Render>;
export function getCollection< export function getCollection<
C extends keyof typeof entryMap, C extends keyof typeof entryMap,
E extends keyof typeof entryMap[C] E extends keyof (typeof entryMap)[C]
>( >(
collection: C, collection: C,
filter?: (data: typeof entryMap[C][E]) => boolean filter?: (data: (typeof entryMap)[C][E]) => boolean
): Promise<(typeof entryMap[C][E] & Render)[]>; ): Promise<((typeof entryMap)[C][E] & Render)[]>;
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer< type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']> import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>

View file

@ -613,5 +613,5 @@ See https://docs.astro.build/en/guides/server-side-rendering/ for more informati
type ValueOf<T> = T[keyof T]; type ValueOf<T> = T[keyof T];
export type AstroErrorCodes = ValueOf<{ export type AstroErrorCodes = ValueOf<{
[T in keyof typeof AstroErrorData]: typeof AstroErrorData[T]['code']; [T in keyof typeof AstroErrorData]: (typeof AstroErrorData)[T]['code'];
}>; }>;