feat(k1): stabilize LAB bridge and isolate onboard device integration
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import type {ComponentType} from 'react';
|
||||
import type {IconName} from '@nodedc/ui-react';
|
||||
import type {Sensor, SensorTransport} from './contracts';
|
||||
import type {EnrollmentTransport} from './enrollment';
|
||||
import type {RerunHostFactory} from './rerunHost';
|
||||
|
||||
export interface SensorDetailProps {
|
||||
device:Sensor; transport:SensorTransport; enabled:boolean;
|
||||
back:()=>void; refresh:()=>Promise<void>; failure:(error:unknown)=>void;
|
||||
createRerunHost?:RerunHostFactory;
|
||||
}
|
||||
export interface SensorEnrollmentProps {
|
||||
transport:EnrollmentTransport; onClose:()=>void; onChange:()=>void;
|
||||
}
|
||||
export interface SensorUiContribution {
|
||||
kind:string;
|
||||
Detail:ComponentType<SensorDetailProps>;
|
||||
icon:IconName;
|
||||
retainOffline:boolean;
|
||||
supportsPreparation:boolean;
|
||||
}
|
||||
|
||||
export function sensorContribution(
|
||||
contributions:readonly SensorUiContribution[], device:Sensor,
|
||||
):SensorUiContribution|undefined {
|
||||
const matches=contributions.filter(value=>value.kind===device.kind);
|
||||
// An ambiguous renderer must not acquire authority over a device.
|
||||
return matches.length===1?matches[0]:undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user