Browse Source

revert(gui-v2): remove nocodb-sdk shims

pull/2837/head
braks 2 years ago
parent
commit
5393c1df85
  1. 1
      packages/nc-gui-v2/.eslintrc.js
  2. 24
      packages/nc-gui-v2/nuxt-shim.d.ts

1
packages/nc-gui-v2/.eslintrc.js

@ -9,4 +9,5 @@ module.exports = {
extends: ['@antfu', 'plugin:prettier/recommended'],
plugins: ['prettier'],
rules: baseRules,
ignorePatterns: ['!*.d.ts'],
}

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

@ -1,16 +1,19 @@
import type messages from '@intlify/vite-plugin-vue-i18n/messages'
import type { RemovableRef } from '@vueuse/core'
import type { Api, FormType, GalleryType, GridType, RequestParams } from 'nocodb-sdk'
import type { Api as BaseAPI } from 'nocodb-sdk'
import type { I18n } from 'vue-i18n'
import type { GlobalState } from './src/lib/types'
import type en from './lang/en.json'
type MessageSchema = typeof en
declare module '#app/nuxt' {
interface NuxtApp {
$api: Api<any>
$api: BaseAPI<any>
/** {@link import('./plugins/tele') Telemetry} */
$tele: {
emit: (event: string, data: any) => void
}
// tele.emit
/** {@link import('./plugins/tele') Telemetry} Emit telemetry event */
$e: (event: string, data?: any) => void
$state: GlobalState
}
@ -18,15 +21,6 @@ declare module '#app/nuxt' {
declare module '@vue/runtime-core' {
interface App {
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>
i18n: I18n<MessageSchema, unknown, unknown, false>['global']
}
}

Loading…
Cancel
Save