commerce/framework/vendure/common/get-all-pages.ts
2021-01-25 21:05:03 +01:00

36 lines
676 B
TypeScript

import { getConfig, VendureConfig } from '../api'
export type Page = any;
export type GetAllPagesResult<
T extends { pages: any[] } = { pages: Page[] }
> = T
async function getAllPages(opts?: {
config?: VendureConfig
preview?: boolean
}): Promise<GetAllPagesResult>
async function getAllPages<T extends { pages: any[] }>(opts: {
url: string
config?: VendureConfig
preview?: boolean
}): Promise<GetAllPagesResult<T>>
async function getAllPages({
config,
preview,
}: {
url?: string
config?: VendureConfig
preview?: boolean
} = {}): Promise<GetAllPagesResult> {
config = getConfig(config)
return {
pages: [],
}
}
export default getAllPages