From 9094b38a8ac2ecafba39c77ed3ba5db14bd1276e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 25 Nov 2021 13:39:44 +0100 Subject: [PATCH] Add pagination types --- package.json | 2 +- types/flaschengeist.d.ts | 14 ++++++++++++++ types/plugin.d.ts | 11 ++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2b927e1..56a4889 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "license": "MIT", - "version": "1.0.0-alpha.6", + "version": "1.0.0-alpha.7", "name": "@flaschengeist/types", "author": "Ferdinand Thiessen ", "homepage": "https://flaschengeist.dev/", diff --git a/types/flaschengeist.d.ts b/types/flaschengeist.d.ts index 96bc55f..9715d78 100644 --- a/types/flaschengeist.d.ts +++ b/types/flaschengeist.d.ts @@ -1,3 +1,7 @@ +/** + * Types used for communicating with the API + */ + declare namespace FG { interface Notification { id: number; @@ -31,4 +35,14 @@ declare namespace FG { name: string; permissions: Array; } + interface PaginationFilter { + limit?: number; + offset?: number; + from?: Date; + to?: Date; + } + interface PaginationResponse { + result: T[]; + count: number; + } } diff --git a/types/plugin.d.ts b/types/plugin.d.ts index 78d4cf3..ec54211 100644 --- a/types/plugin.d.ts +++ b/types/plugin.d.ts @@ -1,6 +1,11 @@ import type { RouteLocationRaw, RouteRecordRaw, RouteRecordName } from 'vue-router'; import type { Component } from '@vue/runtime-core'; +/** + * Types used for defining custom plugins and loading those plugins + * + Additional types for plugin interaction with the core + */ + /* This is some sort of PEP440 subset */ type Join = T extends [] ? '' @@ -114,7 +119,7 @@ export namespace FG_Plugin { /** Name of the target route */ link: RouteRecordName; /** - * Order inside the menu, higher numbers come ahead of lower numbers + * Order inside the menu, higher numbers come ahead of lower numbers * @todo: Promote to required with first beta */ order?: number; @@ -141,9 +146,9 @@ export namespace FG_Plugin { */ priority?: number; /** - * Default order on the dashboard, higher numbers come ahead of lower numbers + * Default order on the dashboard, higher numbers come ahead of lower numbers * @todo Promote to required if priority is removed - */ + */ order?: number; permissions: FG.Permission[]; widget: Component;