Skip to content

Commit

Permalink
chore: added *.d.ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Nov 16, 2024
1 parent 11982cb commit eecb87a
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/layouts/content/list/ListLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ defineOptions({ name: 'ClListLayout' });
.nav-action-group {
.nav-action-item {
margin-right: 10px;
#filter-search {
width: 200px;
}
Expand Down
7 changes: 7 additions & 0 deletions typings/interfaces/i18n/components/role.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface LComponentsRole {
form: {
name: string;
description: string;
pages: string;
};
}
11 changes: 11 additions & 0 deletions typings/interfaces/i18n/views/roles.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
interface LViewsRoles {
table: {
columns: {
name: string;
description: string;
pages: string;
users: string;
};
};
navActions: LNavActions;
}
73 changes: 73 additions & 0 deletions typings/interfaces/models/dependency.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
export declare global {
interface DependencySetting extends BaseModel {
key?: string;
name?: string;
description?: string;
enabled?: boolean;
cmd?: string;
proxy?: string;
last_update_ts?: string;
}

type DependencyStatus =
| 'installing'
| 'installed'
| 'uninstalling'
| 'uninstalled'
| 'error'
| 'abnormal';

type DependencyFileType = 'requirements.txt' | 'package.json';

interface Dependency extends BaseModel {
node_id?: string;
type?: string;
name?: string;
version?: string;
latest_version?: string;
description?: string;
status?: DependencyStatus;
error?: string;
}

interface DependencyRepo {
name?: string;
node_ids?: string[];
versions?: string[];
latest_version?: string;
type?: DependencyLang;
dependencies?: Dependency[];
}

interface DependencyRequirement {
name?: string;
version?: string;
dependencies?: Dependency[];
latest_version?: string;
type?: DependencyLang;
}

type DependencyRepoTabName = 'installed' | 'search';

interface DependencyLog extends BaseModel {
dependency_id?: string;
content?: string;
}

interface DependencyInstallForm {
mode?: 'all' | 'selected-nodes';
name?: string;
version?: string;
node_ids?: string[];
nodes?: CNode[];
}

interface DependencyUninstallForm {
mode?: string;
names?: string[];
node_ids?: string[];
nodes?: CNode[];
}

type DependencyLang = 'python' | 'node';
}
9 changes: 9 additions & 0 deletions typings/interfaces/models/role.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export declare global {
interface Role extends BaseModel {
name?: string;
description?: string;
routes?: string[];
root_admin?: boolean;
users?: number;
}
}
92 changes: 92 additions & 0 deletions typings/interfaces/store/modules/dependency.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
export declare global {
type DependencyStoreModule = BaseModule<
DependencyStoreState,
DependencyStoreGetters,
DependencyStoreMutations,
DependencyStoreActions
>;

interface DependencyStoreState extends BaseStoreState<DependencyRepo> {
lang: DependencyLang;
searchQuery: string;
repoTabName: DependencyRepoTabName;
searchRepoTableLoading: boolean;
searchRepoTableData: TableData<DependencyRepo>;
searchRepoTableTotal: number;
searchRepoTablePagination: TablePagination;
installForm: DependencyInstallForm;
installLoading: boolean;
uninstallForm: DependencyUninstallForm;
uninstallLoading: boolean;
versions: string[];
getVersionsLoading: boolean;
activeDependency?: Dependency;
activeDependencyLogs: DependencyLog[];
}

interface DependencyStoreGetters
extends BaseStoreGetters<DependencyStoreState> {}

interface DependencyStoreMutations
extends BaseStoreMutations<DependencyRepo> {
setLang: (state: DependencyStoreState, lang: DependencyLang) => void;
setSearchQuery: (state: DependencyStoreState, query: string) => void;
setRepoTabName: (
state: DependencyStoreState,
name: DependencyRepoTabName
) => void;
setSearchRepoTableLoading: (
state: DependencyStoreState,
loading: boolean
) => void;
setSearchRepoTableData: (
state: DependencyStoreState,
data: TableDataWithTotal<DependencyRepo>
) => void;
resetSearchRepoTableData: (state: DependencyStoreState) => void;
setSearchRepoTablePagination: (
state: DependencyStoreState,
pagination: TablePagination
) => void;
resetSearchRepoTablePagination: (state: DependencyStoreState) => void;
setInstallForm: (
state: DependencyStoreState,
form: DependencyInstallForm
) => void;
resetInstallForm: (state: DependencyStoreState) => void;
setInstallLoading: (state: DependencyStoreState, loading: boolean) => void;
setUninstallForm: (
state: DependencyStoreState,
form: DependencyUninstallForm
) => void;
resetUninstallForm: (state: DependencyStoreState) => void;
setUninstallLoading: (
state: DependencyStoreState,
loading: boolean
) => void;
setVersions: (state: DependencyStoreState, versions: string[]) => void;
resetVersions: (state: DependencyStoreState) => void;
setGetVersionsLoading: (
state: DependencyStoreState,
loading: boolean
) => void;
setActiveDependency: (
state: DependencyStoreState,
dependency: Dependency
) => void;
resetActiveDependency: (state: DependencyStoreState) => void;
setActiveDependencyLogs: (
state: DependencyStoreState,
logs: DependencyLog[]
) => void;
resetActiveDependencyLogs: (state: DependencyStoreState) => void;
}

interface DependencyStoreActions extends BaseStoreActions<DependencyRepo> {
searchRepoList: StoreAction<DependencyStoreState>;
getRepoVersions: StoreAction<DependencyStoreState>;
installDependency: StoreAction<DependencyStoreState>;
uninstallDependency: StoreAction<DependencyStoreState>;
getActiveDependencyLogs: StoreAction<DependencyStoreState>;
}
}
23 changes: 23 additions & 0 deletions typings/interfaces/store/modules/role.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export declare global {
type RoleStoreModule = BaseModule<
RoleStoreState,
RoleStoreGetters,
RoleStoreMutations,
RoleStoreActions
>;

interface RoleStoreState extends BaseStoreState<Role> {
pagesCheckAllStatus: CheckboxStatus;
}

interface RoleStoreGetters extends BaseStoreGetters<Role> {}

interface RoleStoreMutations extends BaseStoreMutations<Role> {
setPagesCheckAllStatus: (
state: RoleStoreState,
status: CheckboxStatus
) => void;
}

interface RoleStoreActions extends BaseStoreActions<Role> {}
}

0 comments on commit eecb87a

Please sign in to comment.