import type refactor

This commit is contained in:
Jan Prochazka
2022-11-03 16:40:54 +01:00
parent 6c7e263f0e
commit f713a4b183
53 changed files with 54 additions and 67 deletions

View File

@@ -16,7 +16,7 @@
tabComponent,
tooltip,
props: {
savedFile:fileName + '.' + fileType,
savedFile: fileName + '.' + fileType,
savedFolder: 'app:' + folderName,
savedFormat: 'text',
appFolder: folderName,
@@ -28,7 +28,10 @@
}
export const extractKey = data => data.fileName;
export const createMatcher = ({ fileName }) => filter => filterName(filter, fileName);
export const createMatcher =
({ fileName }) =>
filter =>
filterName(filter, fileName);
const APP_ICONS = {
'config.json': 'img json',
'command.sql': 'img app-command',
@@ -50,7 +53,6 @@
import InputTextModal from '../modals/InputTextModal.svelte';
import ConfirmModal from '../modals/ConfirmModal.svelte';
import { apiCall } from '../utility/api';
import { currentDatabase, currentDatabase } from '../stores';
export let data;

View File

@@ -1,5 +1,5 @@
import { dumpSqlSelect, Select } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types';
import type { Select } from 'dbgate-sqltree';
import type { EngineDriver } from 'dbgate-types';
import _ from 'lodash';
import { apiCall } from '../utility/api';

View File

@@ -1,6 +1,6 @@
import { tick } from 'svelte';
import { commands } from '../stores';
import { GlobalCommand } from './registerCommand';
import type { GlobalCommand } from './registerCommand';
let isInvalidated = false;

View File

@@ -1,7 +1,5 @@
import _ from 'lodash';
import { dumpSqlSelect, Select, JoinType, Condition, Relation, mergeConditions, Source } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import type { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { findPrimaryTable, findConnectingReference, referenceIsJoin, referenceIsExists } from './designerTools';
export class DesignerComponent {

View File

@@ -10,7 +10,6 @@ import {
ResultField,
Expression,
} from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { DesignerComponent } from './DesignerComponentCreator';
import {

View File

@@ -1,7 +1,8 @@
import _ from 'lodash';
import { dumpSqlSelect, Select, JoinType, Condition, Relation, mergeConditions, Source } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import type { Select, Condition, Source } from 'dbgate-sqltree';
import { dumpSqlSelect, mergeConditions } from 'dbgate-sqltree';
import type { EngineDriver } from 'dbgate-types';
import type { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { DesignerComponentCreator } from './DesignerComponentCreator';
import { DesignerQueryDumper } from './DesignerQueryDumper';
import { getFilterType } from 'dbgate-filterparser';

View File

@@ -1,5 +1,5 @@
import { JoinType } from 'dbgate-sqltree';
import { TableInfo } from 'dbgate-types';
import type { JoinType } from 'dbgate-sqltree';
import type { TableInfo } from 'dbgate-types';
export type DesignerTableInfo = TableInfo & {
designerId: string;

View File

@@ -8,7 +8,7 @@
PerspectiveTreeNode,
switchPerspectiveReferenceDirection,
} from 'dbgate-datalib';
import { CollectionInfo } from 'dbgate-types';
import type { CollectionInfo } from 'dbgate-types';
import _ from 'lodash';
import { tick } from 'svelte';
import runCommand from '../commands/runCommand';

View File

@@ -1,4 +1,4 @@
import { FileFormatDefinition, QuickExportDefinition } from 'dbgate-types';
import type { FileFormatDefinition, QuickExportDefinition } from 'dbgate-types';
const jsonlFormat = {
storageType: 'jsonl',

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { ThemeDefinition } from 'dbgate-types';
import type { ThemeDefinition } from 'dbgate-types';
import FontIcon from '../icons/FontIcon.svelte';
import { currentTheme } from '../stores';
import _ from 'lodash';

View File

@@ -1,5 +1,5 @@
import { writable, derived, readable } from 'svelte/store';
import { ExtensionsDirectory } from 'dbgate-types';
import type { ExtensionsDirectory } from 'dbgate-types';
import invalidateCommands from './commands/invalidateCommands';
import getElectron from './utility/getElectron';
import { getSettings, useConfig, useSettings } from './utility/metadataLoaders';

View File

@@ -1,4 +1,4 @@
import { ApplicationDefinition, StoredConnection } from 'dbgate-types';
import type { ApplicationDefinition, StoredConnection } from 'dbgate-types';
import { apiCall } from '../utility/api';
export async function saveDbToApp(conid: string, database: string, app: string) {

View File

@@ -1,4 +1,4 @@
import { QuickExportDefinition } from 'dbgate-types';
import type { QuickExportDefinition } from 'dbgate-types';
import { getExtensions } from '../stores';
export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function, advancedExportMenuItem) {

View File

@@ -1,5 +1,5 @@
import { DictionaryDescription } from 'dbgate-datalib';
import { ApplicationDefinition, TableInfo } from 'dbgate-types';
import type { ApplicationDefinition, TableInfo } from 'dbgate-types';
import _ from 'lodash';
import { apiCall } from './api';
import { filterAppsForDatabase, saveDbToApp } from './appTools';

View File

@@ -1,8 +1,6 @@
import _ from 'lodash';
import { loadCachedValue, subscribeCacheChange, unsubscribeCacheChange } from './cache';
import stableStringify from 'json-stable-stringify';
import getAsArray from './getAsArray';
import { DatabaseInfo } from 'dbgate-types';
import { derived } from 'svelte/store';
import { extendDatabaseInfo } from 'dbgate-tools';
import { setLocalStorage } from '../utility/storageCache';