Skip to content

Commit a5b8703

Browse files
committed
chore(platform): add AppDocs namespace
1 parent 72ee7c6 commit a5b8703

4 files changed

Lines changed: 22 additions & 17 deletions

File tree

packages/platform/src/app/core/http/mock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AppNotification, AppUser, DeviceDoc } from '../../utils/types';
1+
import type { AppNotification, AppUser } from '../../utils/types';
22
import type { JWTToken, JWTTokenPayload } from '../token';
33

44
import axios from 'axios';
@@ -47,7 +47,7 @@ if (environment.http.mock) {
4747
list: Array.from({ length: 3 }).map((_, i) => ({ message: `This is message ${i}`, read: false })),
4848
},
4949
];
50-
const deviceList = Array.from({ length: 108 }).map<DeviceDoc>((_, i) => ({
50+
const deviceList = Array.from({ length: 108 }).map<AppDocs.Device>((_, i) => ({
5151
id: i,
5252
create_time: Date.now() + 60 * 60 * 1000,
5353
update_time: Date.now() + 60 * 60 * 1000,

packages/platform/src/app/routes/list/standard-table/StandardTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DeviceDoc, StandardQueryParams } from '../../../utils/types';
1+
import type { StandardQueryParams } from '../../../utils/types';
22
import type { DSelectItem } from '@react-devui/ui/components/select';
33

44
import { isUndefined } from 'lodash';
@@ -17,7 +17,7 @@ import { AppDeviceModal } from './DeviceModal';
1717

1818
import styles from './StandardTable.module.scss';
1919

20-
export type DeviceData = DeviceDoc;
20+
export type DeviceData = AppDocs.Device;
2121

2222
interface DeviceQueryParams {
2323
keyword: string;

packages/platform/src/app/utils/types.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,4 @@ export interface StandardQueryParams {
2626
[index: string]: any;
2727
}
2828

29-
export interface StandardFields {
30-
id: number;
31-
create_time: number;
32-
update_time: number;
33-
}
34-
35-
export interface DeviceDoc extends StandardFields {
36-
name: string;
37-
model: string;
38-
price: number;
39-
status: number;
40-
}
41-
4229
export {};

packages/platform/src/docs.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
interface StandardFields {
2+
id: number;
3+
create_time: number;
4+
update_time: number;
5+
}
6+
7+
declare global {
8+
declare namespace AppDocs {
9+
export interface Device extends StandardFields {
10+
name: string;
11+
model: string;
12+
price: number;
13+
status: number;
14+
}
15+
}
16+
}
17+
18+
export {};

0 commit comments

Comments
 (0)