Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove UnknownExtra #298

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/interfaces/extra.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { ItemType } from '../constants';

export interface UnknownExtra {
[key: string]: unknown;
}

/**
* Document style flavor defined according to severity prop of
* https://mui.com/material-ui/react-alert/
Expand All @@ -22,7 +18,7 @@ export type DocumentItemExtraProperties = {
flavor?: DocumentItemExtraFlavor | `${DocumentItemExtraFlavor}`;
};

export interface DocumentItemExtra extends UnknownExtra {
export interface DocumentItemExtra {
[ItemType.DOCUMENT]: DocumentItemExtraProperties;
}

Expand All @@ -33,7 +29,7 @@ export type EmbeddedLinkItemExtraProperties = {
icons?: string[];
};

export interface EmbeddedLinkItemExtra extends UnknownExtra {
export interface EmbeddedLinkItemExtra {
[ItemType.LINK]: EmbeddedLinkItemExtraProperties;
}

Expand All @@ -42,14 +38,14 @@ export type FolderItemExtraProperties = {
isRoot?: boolean;
};

export interface FolderItemExtra extends UnknownExtra {
export interface FolderItemExtra {
[ItemType.FOLDER]: FolderItemExtraProperties;
}

export type ShortcutItemExtraProperties = {
target: string;
};

export interface ShortcutItemExtra extends UnknownExtra {
export interface ShortcutItemExtra {
[ItemType.SHORTCUT]: ShortcutItemExtraProperties;
}
6 changes: 3 additions & 3 deletions src/services/app/interfaces/extra.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ItemType } from '../../../constants';
import { UnknownExtra } from '../../../interfaces';

export type AppItemExtraProperties = {
url: string;
settings?: UnknownExtra;
// todo: there currently is nothing stored in the settings. this might change later
settings?: unknown;
};

export interface AppItemExtra extends UnknownExtra {
export interface AppItemExtra {
[ItemType.APP]: AppItemExtraProperties;
}
3 changes: 1 addition & 2 deletions src/services/etherpad/interfaces/etherpad.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ItemType } from '../../../constants';
import { UnknownExtra } from '@/index';

/**
* This type refers to the result sent by the server when querying
Expand All @@ -14,6 +13,6 @@ export type EtherpadItemExtraProperties = {
groupID: string;
};

export interface EtherpadItemExtra extends UnknownExtra {
export interface EtherpadItemExtra {
[ItemType.ETHERPAD]: EtherpadItemExtraProperties;
}
5 changes: 2 additions & 3 deletions src/services/file/interfaces/extra.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ItemType } from '../../../constants';
import { UnknownExtra } from '../../../interfaces';

/**
* @deprecated Use FileItemProperties instead
Expand All @@ -19,11 +18,11 @@ export type FileItemProperties = {
content: string;
};

export interface LocalFileItemExtra extends UnknownExtra {
export interface LocalFileItemExtra {
[ItemType.LOCAL_FILE]: FileItemProperties;
}

export interface S3FileItemExtra extends UnknownExtra {
export interface S3FileItemExtra {
[ItemType.S3_FILE]: FileItemProperties;
}

Expand Down
3 changes: 1 addition & 2 deletions src/services/h5p/interfaces/extra.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ItemType } from '../../../constants';
import { UnknownExtra } from '../../../interfaces';

export type H5PItemExtraProperties = {
/** storage ID */
Expand All @@ -10,6 +9,6 @@ export type H5PItemExtraProperties = {
contentFilePath: string;
};

export interface H5PItemExtra extends UnknownExtra {
export interface H5PItemExtra {
[ItemType.H5P]: H5PItemExtraProperties;
}
10 changes: 3 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es6",
"module": "CommonJS",
"module": "node16",
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
"outDir": "dist",
"esModuleInterop": true,
"skipLibCheck": true,
Expand All @@ -18,12 +18,8 @@
"strictNullChecks": true,
"baseUrl": "./src",
"paths": {
"@/*": [
"./*"
]
"@/*": ["./*"]
}
},
"include": [
"src/**/*"
],
"include": ["src/**/*"]
}