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