Interface: IAstroService
Defined in: src/types/index.ts:574
Contract of the Astro facade.
Methods
useExtractUniqueValues()
useExtractUniqueValues<
T,V>(items,keyFrom):V[]
Defined in: src/types/index.ts:598
Type Parameters
T
T
V
V
Parameters
items
T[]
keyFrom
(item) => V | V[]
Returns
V[]
useFindEntry()
useFindEntry<
T>(items,value,keyFrom?):T|null
Defined in: src/types/index.ts:588
Type Parameters
T
T
Parameters
items
T[]
value
string
keyFrom?
(item) => string | number
Returns
T | null
useGeneratePagination()
useGeneratePagination<
T,TParam>(items,pageSize?,param?):AstroPath<TParam,PaginationProps<T>>[]
Defined in: src/types/index.ts:589
Type Parameters
T
T
TParam
TParam extends string = "page"
Parameters
items
T[]
pageSize?
number
param?
TParam
Returns
AstroPath<TParam, PaginationProps<T>>[]
useGetStaticPaths()
useGetStaticPaths<
TData,TParam,TProps>(getCollectionFn,collectionName,options?):Promise<AstroServiceResult<AstroPath<TParam,TProps>[]>>
Defined in: src/types/index.ts:579
Type Parameters
TData
TData = unknown
TParam
TParam extends string = "slug"
TProps
TProps = CollectionEntryLike<TData>
Parameters
getCollectionFn
(collection) => Promise<CollectionEntryLike<TData>[]>
collectionName
string
options?
PathsOptions<CollectionEntryLike<TData>, TParam, TProps>
Returns
Promise<AstroServiceResult<AstroPath<TParam, TProps>[]>>
usePathsFrom()
usePathsFrom<
T,TParam,TProps>(items,options?):AstroPath<TParam,TProps>[]
Defined in: src/types/index.ts:575
Type Parameters
T
T
TParam
TParam extends string = "slug"
TProps
TProps = T
Parameters
items
T[]
options?
PathsOptions<T, TParam, TProps>
Returns
AstroPath<TParam, TProps>[]
usePathsFromValues()
usePathsFromValues<
TParam>(values,param?):AstroPath<TParam,string|number>[]
Defined in: src/types/index.ts:594
Type Parameters
TParam
TParam extends string = "slug"
Parameters
values
(string | number)[]
param?
TParam
Returns
AstroPath<TParam, string | number>[]