mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-29 20:07:01 +01:00
42 lines
737 B
TypeScript
42 lines
737 B
TypeScript
import {state, StateStream} from "lstream";
|
|
import {ApplicationContext} from "cad/context";
|
|
import {MShell} from "../model/mshell";
|
|
import {LocationDialog} from "./LocationDialog";
|
|
|
|
export function activate(ctx: ApplicationContext) {
|
|
|
|
ctx.domService.contributeComponent(LocationDialog);
|
|
|
|
const editLocationRequest$ = state(null);
|
|
|
|
ctx.locationService = {
|
|
editLocationRequest$,
|
|
|
|
edit: shell => {
|
|
editLocationRequest$.next({
|
|
shell
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
|
|
export interface EditLocationRequest {
|
|
|
|
shell: MShell;
|
|
|
|
}
|
|
|
|
export interface LocationService {
|
|
|
|
editLocationRequest$: StateStream<EditLocationRequest>;
|
|
|
|
edit(shell);
|
|
|
|
}
|
|
|
|
export interface LocationBundleContext {
|
|
|
|
locationService: LocationService;
|
|
}
|
|
|