| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import type ApiResource from '~/models/ApiResource'
- import type { EnumChoice } from '~/types/interfaces'
- import type {
- Query as PiniaOrmQuery,
- Collection as PiniaOrmCollection,
- } from 'pinia-orm'
- type AnyJson = Record<string, any>
- interface AssociativeArray {
- [key: string]: any
- }
- interface Connector {
- request(
- method: HTTP_METHOD,
- url: string,
- body: null | any,
- params: null | AssociativeArray,
- query: null | AssociativeArray,
- )
- }
- interface HydraMetadata {
- readonly totalItems?: number
- firstPage?: number
- lastPage?: number
- nextPage?: number
- previousPage?: number
- type?: METADATA_TYPE
- }
- interface ApiResponse {
- data: AnyJson
- metadata: HydraMetadata
- }
- interface ApiCollection extends ApiResponse {
- data: AnyJson
- metadata: HydraMetadata
- }
- interface Pagination {
- first?: number
- last?: number
- next?: number
- previous?: number
- }
- interface Collection {
- items: PiniaOrmCollection<ApiResource>
- pagination: Pagination
- totalItems: number | undefined
- }
- interface ApiFilter {
- applyToPiniaOrmQuery: (
- query: PiniaOrmQuery<ApiResource>,
- ) => PiniaOrmQuery<ApiResource>
- getApiQueryPart: () => string
- }
- interface EnumItem {
- value: string
- label: string
- }
- type Enum = Array<EnumChoice>
|