Skip to content
Snippets Groups Projects
Commit b532c7da authored by Michal Malý's avatar Michal Malý
Browse files

ReDNATCO plugin stage 22

parent b292c87f
No related branches found
No related tags found
No related merge requests found
...@@ -39,8 +39,8 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object { ...@@ -39,8 +39,8 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object {
this.target!.loadStructure(data, type); this.target!.loadStructure(data, type);
} }
query(type: ReDNATCOMspApi.Queries.Type): ReDNATCOMspApi.Response { query<T extends ReDNATCOMspApi.Queries.Type>(type: T): ReDNATCOMspApi.ResponseTypes[T] {
this.check(); this.check();
return this.target!.apiQuery(type); return this.target!.apiQuery(type) as ReDNATCOMspApi.ResponseTypes[T];
} }
} }
...@@ -106,6 +106,10 @@ export namespace ReDNATCOMspApi { ...@@ -106,6 +106,10 @@ export namespace ReDNATCOMspApi {
} }
} }
export type Response = Queries.CurrentFilter|Queries.SelectedStep; export type Response = Queries.CurrentFilter|Queries.SelectedStep;
export type ResponseTypes = {
'current-filter': Queries.CurrentFilter,
'selected-step': Queries.SelectedStep,
}
export interface Object { export interface Object {
command: (cmd: Command) => void; command: (cmd: Command) => void;
...@@ -113,6 +117,6 @@ export namespace ReDNATCOMspApi { ...@@ -113,6 +117,6 @@ export namespace ReDNATCOMspApi {
init: (elemId: string, onEvent?: (evt: Event) => void) => void; init: (elemId: string, onEvent?: (evt: Event) => void) => void;
isReady: () => boolean; isReady: () => boolean;
loadStructure: (data: string, type: 'cif'|'pdb') => void; loadStructure: (data: string, type: 'cif'|'pdb') => void;
query: (type: Queries.Type) => Response; query: <T extends Queries.Type>(type: T) => ResponseTypes[T];
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment