Browse Source

fix(gui-v2): shim API functions (swagger outdated)

pull/2837/head
braks 2 years ago
parent
commit
82e8f7fae9
  1. 18
      packages/nc-gui-v2/nuxt-shim.d.ts

18
packages/nc-gui-v2/nuxt-shim.d.ts vendored

@ -1,13 +1,12 @@
import type messages from '@intlify/vite-plugin-vue-i18n/messages'
import type { RemovableRef } from '@vueuse/core'
import type { Api } from 'nocodb-sdk'
import type { Api, FormType, GalleryType, GridType, RequestParams } from 'nocodb-sdk'
import type { I18n } from 'vue-i18n'
import type { GlobalState } from '~/lib/types'
import type messages from '@intlify/vite-plugin-vue-i18n/messages'
import type { GlobalState } from './src/lib/types'
declare module '#app/nuxt' {
interface NuxtApp {
$api: Api<any>;
$api: Api<any>
$tele: {
emit: (event: string, data: any) => void
}
@ -22,3 +21,12 @@ declare module '@vue/runtime-core' {
i18n: I18n<messages, unknown, unknown, false>['global']
}
}
declare module 'nocodb-sdk' {
interface Api<T> {
// todo: update swagger to accept correct data type
gridCreate: (tableId: string, data: GridType & { copy_from_id: string }, params?: RequestParams) => Promise<GridType>
formCreate: (tableId: string, data: FormType, params?: RequestParams) => Promise<FormType>
galleryCreate: (tableId: string, data: GalleryType, params?: RequestParams) => Promise<any>
}
}

Loading…
Cancel
Save