马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
这是个箭头函数吗?()还可以指定类别!
(): ServerState => {export const defaultState = (): ServerState => {
return {
klippy_retries: 0, // how many times have we attempted to reconnect to klippy.
info: {
failed_components: [],
klippy_connected: false, // indicates if klippy is disconnected vs shutdown.
klippy_state: '',
components: [],
registered_directories: [],
warnings: []
},
system_info: null,
config: {
authorization: {
enabled: true
},
server: {}
},
moonraker_stats: [],
throttled_state: {
bits: 0,
flags: []
},
cpu_temp: null
}
}
这两个名称分别代表什么内容?
interface ServerState
export interface ServerState {
klippy_retries: number;
info: ServerInfo;
system_info: SystemInfo | null;
config: ServerConfig;
moonraker_stats: ServerSystemStat[];
throttled_state: ServerThrottledState | null;
cpu_temp: number | null;
}
|