Remove unused code and update types

This commit is contained in:
Mauro Balades 2024-08-06 10:57:17 +02:00
parent 8d0d7b3902
commit fc5933fcfd
6 changed files with 31 additions and 23 deletions

12
@types/split-views.d.ts vendored Normal file
View file

@ -0,0 +1,12 @@
declare type SplitType = 'horizontal' | 'vertical' | 'grid';
declare interface SplitViewConfig extends Config {
keyIndicator: string; // e.g. "split-tab='true'"
defaultSplitView: SplitType;
};
declare interface SplitView {
type: SplitType;
tabs: MockedExports.BrowserTab[];
};

View file

@ -1,19 +1,29 @@
class SplitViewsBase {
/**
* @param {SplitViewConfig} config
* @param {SplitViewData[]} data
* @param {number} currentView
* @type {SplitView[]}
*/
data;
/**
* @param {SplitViewConfig} config
*/
constructor(config) {
this.config = config.awd;
this.config = config;
this.data = [];
this.currentView = -1;
this.addEventListeners();
this.log('SplitViewsBase initialized');
}
/**
* @param {string} message
* @protected
*/
log(message) {
console.log(`SplitViews: ${message}`);
}
addEventListeners() {
window.addEventListener('TabClose', this);
}
@ -92,7 +102,7 @@ export class SplitViews extends SplitViewsBase {
* @param {SplitType} type
* @private
*/
createSplitView(tabs, type = this.viewConfig.defaultSplitView) {
createSplitView(tabs, type = this.config.defaultSplitView) {
this.log('createSplitView');
}
};

13
src/types.d.ts vendored
View file

@ -1,13 +0,0 @@
import { Config } from "./common";
export type SplitType = 'horizontal' | 'vertical' | 'grid';
export interface SplitViewConfig {
keyIndicator: string; // e.g. "split-tab='true'"
defaultSplitView: SplitType;
};
export interface SplitView {
type: SplitType;
tabs: MockedExports.BrowserTab[];
};

View file

@ -27,17 +27,16 @@
// Allow esnext syntax. Otherwise the default is ES5 only.
"target": "esnext",
"lib": ["esnext", "dom"],
"noEmit": true,
/* Modules */
"module": "CommonJS", /* Specify what module code is generated. */
//"rootDir": "./src", /* Specify the root folder within your source files. */
"rootDir": "./src", /* Specify the root folder within your source files. */
// "moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
"typeRoots": ["./@types"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
@ -48,9 +47,9 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./dist/components.js", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */