fix(优化)
This commit is contained in:
3
src/types/env.d.ts
vendored
3
src/types/env.d.ts
vendored
@@ -2,6 +2,9 @@
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_BASE_URL?: string
|
||||
readonly VITE_API_PROXY_TARGET?: string
|
||||
readonly VITE_HIKVISION_PROXY_TARGET?: string
|
||||
readonly VITE_HIKVISION_WS_PROXY_TARGET?: string
|
||||
readonly VITE_LOGS_API_BASE_URL?: string
|
||||
// 在这里可以继续补充其他 VITE_ 前缀的环境变量
|
||||
}
|
||||
|
||||
55
src/types/hikvision-web-sdk.d.ts
vendored
Normal file
55
src/types/hikvision-web-sdk.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/** 海康 WebSDK 通用异步回调。 */
|
||||
interface HikvisionSdkCallbacks {
|
||||
success?: (xmlDoc?: Document) => void
|
||||
error?: (status?: number, xmlDoc?: Document) => void
|
||||
}
|
||||
|
||||
/** 海康 WebSDK 初始化参数。 */
|
||||
interface HikvisionPluginOptions {
|
||||
bWndFull: boolean
|
||||
iPackageType: number
|
||||
iWndowType: number
|
||||
bNoPlugin: boolean
|
||||
cbInitPluginComplete: () => void
|
||||
cbPluginErrorHandler: (windowIndex: number, errorCode: number, error?: unknown) => void
|
||||
cbPerformanceLack: () => void
|
||||
cbSecretKeyError: (windowIndex: number) => void
|
||||
}
|
||||
|
||||
/** 海康实时预览参数。 */
|
||||
interface HikvisionRealPlayOptions extends HikvisionSdkCallbacks {
|
||||
iWndIndex: number
|
||||
iRtspPort: number
|
||||
iStreamType: number
|
||||
iChannelID: number
|
||||
iWSPort?: number
|
||||
bZeroChannel: boolean
|
||||
bProxy: boolean
|
||||
}
|
||||
|
||||
/** 海康 WebSDK 暴露到 window 的控制器。 */
|
||||
interface HikvisionWebVideoCtrl {
|
||||
I_SupportNoPlugin: () => boolean
|
||||
I_InitPlugin: (width: string, height: string, options: HikvisionPluginOptions) => void
|
||||
I_InsertOBJECTPlugin: (containerId: string) => number
|
||||
I_Login: (
|
||||
host: string,
|
||||
protocol: number,
|
||||
port: string,
|
||||
username: string,
|
||||
password: string,
|
||||
callbacks: HikvisionSdkCallbacks
|
||||
) => number | void
|
||||
I_Logout: (deviceIdentify: string) => number
|
||||
I_StartRealPlay: (deviceIdentify: string, options: HikvisionRealPlayOptions) => void
|
||||
I_GetWindowStatus: (windowIndex: number) => { szDeviceIdentify?: string } | null
|
||||
I_Stop: (options: HikvisionSdkCallbacks & { iIndex?: number }) => void
|
||||
I_StopAll: () => Promise<unknown> | void
|
||||
I_Resize: (width: number, height: number) => void
|
||||
I_DestroyWorker: () => void
|
||||
I_SetSecretKey: (secretKey: string, windowIndex: number) => Promise<unknown>
|
||||
}
|
||||
|
||||
interface Window {
|
||||
WebVideoCtrl?: HikvisionWebVideoCtrl
|
||||
}
|
||||
Reference in New Issue
Block a user