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

Linter

parent 6219d8e5
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,8 @@ import { ReDNATCOMsp } from './index'; ...@@ -2,8 +2,8 @@ import { ReDNATCOMsp } from './index';
import { ReDNATCOMspApi } from './api'; import { ReDNATCOMspApi } from './api';
export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object { export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object {
private target: ReDNATCOMsp|undefined = undefined; private target: ReDNATCOMsp | undefined = undefined;
private onEvent: ((evt: ReDNATCOMspApi.Event) => void)|undefined; private onEvent: ((evt: ReDNATCOMspApi.Event) => void) | undefined;
private check() { private check() {
if (!this.target) if (!this.target)
...@@ -34,7 +34,7 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object { ...@@ -34,7 +34,7 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object {
return !!this.target; return !!this.target;
} }
loadStructure(coords: { data: string, type: 'cif'|'pdb' }, densityMaps: { data: Uint8Array, type: 'ccp4'|'dsn6', kind: '2fo-fc'|'fo-fc'|'em' }[]|null) { loadStructure(coords: { data: string, type: 'cif' | 'pdb' }, densityMaps: { data: Uint8Array, type: 'ccp4' | 'dsn6', kind: '2fo-fc' | 'fo-fc' | 'em' }[] | null) {
this.check(); this.check();
this.target!.loadStructure(coords, densityMaps); this.target!.loadStructure(coords, densityMaps);
} }
......
...@@ -15,7 +15,7 @@ export namespace ReDNATCOMspApi { ...@@ -15,7 +15,7 @@ export namespace ReDNATCOMspApi {
} }
export namespace Commands { export namespace Commands {
export type Type = 'deselect-step'|'filter'|'redraw'|'select-step'|'switch-model'; export type Type = 'deselect-step' | 'filter' | 'redraw' | 'select-step' | 'switch-model';
export type DeselectStep = { type: 'deselect-step' } export type DeselectStep = { type: 'deselect-step' }
export function DeselectStep(): DeselectStep { export function DeselectStep(): DeselectStep {
...@@ -36,7 +36,7 @@ export namespace ReDNATCOMspApi { ...@@ -36,7 +36,7 @@ export namespace ReDNATCOMspApi {
prev?: Payloads.StepSelection; prev?: Payloads.StepSelection;
next?: Payloads.StepSelection next?: Payloads.StepSelection
} }
export function SelectStep(step: Payloads.StepSelection, prev: Payloads.StepSelection|undefined, next: Payloads.StepSelection|undefined): SelectStep { export function SelectStep(step: Payloads.StepSelection, prev: Payloads.StepSelection | undefined, next: Payloads.StepSelection | undefined): SelectStep {
return { type: 'select-step', step, prev, next }; return { type: 'select-step', step, prev, next };
} }
...@@ -51,7 +51,7 @@ export namespace ReDNATCOMspApi { ...@@ -51,7 +51,7 @@ export namespace ReDNATCOMspApi {
Commands.SwitchModel; Commands.SwitchModel;
export namespace Events { export namespace Events {
export type Type = 'filter'|'ready'|'step-deselected'|'step-requested'|'step-selected'|'structure-loaded'; export type Type = 'filter' | 'ready' | 'step-deselected' | 'step-requested' | 'step-selected' | 'structure-loaded';
export type Filter = { type: 'filter', success: boolean, message: string } export type Filter = { type: 'filter', success: boolean, message: string }
export function FilterApplied(): Filter { export function FilterApplied(): Filter {
...@@ -97,7 +97,7 @@ export namespace ReDNATCOMspApi { ...@@ -97,7 +97,7 @@ export namespace ReDNATCOMspApi {
Events.StructureLoaded; Events.StructureLoaded;
export namespace Queries { export namespace Queries {
export type Type = 'current-filter'|'current-model-number'|'selected-step'; export type Type = 'current-filter' | 'current-model-number' | 'selected-step';
export type CurrentFilter = { type: 'current-filter', filter: Filters.All } export type CurrentFilter = { type: 'current-filter', filter: Filters.All }
export function CurrentFilter(filter: Filters.All): CurrentFilter { export function CurrentFilter(filter: Filters.All): CurrentFilter {
...@@ -114,7 +114,7 @@ export namespace ReDNATCOMspApi { ...@@ -114,7 +114,7 @@ export namespace ReDNATCOMspApi {
return { type: 'selected-step', selected }; return { type: 'selected-step', selected };
} }
} }
export type Response = Queries.CurrentFilter|Queries.CurrentModelNumber|Queries.SelectedStep; export type Response = Queries.CurrentFilter | Queries.CurrentModelNumber | Queries.SelectedStep;
export type ResponseTypes = { export type ResponseTypes = {
'current-filter': Queries.CurrentFilter, 'current-filter': Queries.CurrentFilter,
'current-model-number': Queries.CurrentModelNumber, 'current-model-number': Queries.CurrentModelNumber,
...@@ -126,7 +126,7 @@ export namespace ReDNATCOMspApi { ...@@ -126,7 +126,7 @@ export namespace ReDNATCOMspApi {
event: (evt: Event) => void; event: (evt: Event) => void;
init: (elemId: string, onEvent?: (evt: Event) => void) => void; init: (elemId: string, onEvent?: (evt: Event) => void) => void;
isReady: () => boolean; isReady: () => boolean;
loadStructure: (coords: { data: string, type: 'cif'|'pdb'}, densityMaps: { data: Uint8Array, type: 'ccp4'|'dsn6', kind: '2fo-fc'|'fo-fc'|'em' }[]|null) => void; loadStructure: (coords: { data: string, type: 'cif' | 'pdb'}, densityMaps: { data: Uint8Array, type: 'ccp4' | 'dsn6', kind: '2fo-fc' | 'fo-fc' | 'em' }[] | null) => void;
query: <T extends Queries.Type>(type: T) => ResponseTypes[T]; query: <T extends Queries.Type>(type: T) => ResponseTypes[T];
} }
} }
...@@ -68,7 +68,7 @@ export function reduceDecimals(s: string) { ...@@ -68,7 +68,7 @@ export function reduceDecimals(s: string) {
if (s.charCodeAt(idx) !== Zero) if (s.charCodeAt(idx) !== Zero)
break; break;
} }
const noDot = s.charCodeAt(idx) === Period ? 0 : 1 const noDot = s.charCodeAt(idx) === Period ? 0 : 1;
return s.substring(0, idx + noDot); return s.substring(0, idx + noDot);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment