Skip to content

IAstroService

katanakit-js / IAstroService

Defined in: types/adapters/astro.ts:39

Contract of the Astro facade.

useExtractUniqueValues<T, V>(items, keyFrom): V[];

Defined in: types/adapters/astro.ts:63

Type Parameter
T
V
Parameter Type
items T[]
keyFrom (item) => V | V[]

V[]


useFindEntry<T>(
items,
value,
keyFrom?
): T | null;

Defined in: types/adapters/astro.ts:53

Type Parameter
T
Parameter Type
items T[]
value string
keyFrom? (item) => string | number

T | null


useGeneratePagination<T, TParam>(
items,
pageSize?,
param?
): AstroPath<TParam, PaginationProps<T>>[];

Defined in: types/adapters/astro.ts:54

Type Parameter Default type
T -
TParam extends string "page"
Parameter Type
items T[]
pageSize? number
param? TParam

AstroPath<TParam, PaginationProps<T>>[]


useGetStaticPaths<TData, TParam, TProps>(
getCollectionFn,
collectionName,
options?
): Promise<AstroServiceResult<AstroPath<TParam, TProps>[]>>;

Defined in: types/adapters/astro.ts:44

Type Parameter Default type
TData unknown
TParam extends string "slug"
TProps CollectionEntryLike<TData>
Parameter Type
getCollectionFn (collection) => Promise<CollectionEntryLike<TData>[]>
collectionName string
options? PathsOptions<CollectionEntryLike<TData>, TParam, TProps>

Promise<AstroServiceResult<AstroPath<TParam, TProps>[]>>


usePathsFrom<T, TParam, TProps>(items, options?): AstroPath<TParam, TProps>[];

Defined in: types/adapters/astro.ts:40

Type Parameter Default type
T -
TParam extends string "slug"
TProps T
Parameter Type
items T[]
options? PathsOptions<T, TParam, TProps>

AstroPath<TParam, TProps>[]


usePathsFromValues<TParam>(values, param?): AstroPath<TParam, string | number>[];

Defined in: types/adapters/astro.ts:59

Type Parameter Default type
TParam extends string "slug"
Parameter Type
values (string | number)[]
param? TParam

AstroPath<TParam, string | number>[]