diff --git a/src/apps/rednatco/api-impl.ts b/src/apps/rednatco/api-impl.ts index d9940fa8a9aa682c23732779d988afc26e2e226a..bed5fbff2daab5e983ce9dae321475cac1b83579 100644 --- a/src/apps/rednatco/api-impl.ts +++ b/src/apps/rednatco/api-impl.ts @@ -2,8 +2,8 @@ import { ReDNATCOMsp } from './index'; import { ReDNATCOMspApi } from './api'; export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object { - private target: ReDNATCOMsp|undefined = undefined; - private onEvent: ((evt: ReDNATCOMspApi.Event) => void)|undefined; + private target: ReDNATCOMsp | undefined = undefined; + private onEvent: ((evt: ReDNATCOMspApi.Event) => void) | undefined; private check() { if (!this.target) @@ -34,7 +34,7 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object { 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.target!.loadStructure(coords, densityMaps); } diff --git a/src/apps/rednatco/api.ts b/src/apps/rednatco/api.ts index 09a30b75b6e6a3223376caf251c4952643874e06..1652681da019ee27c21a111cd1a46773b713ed20 100644 --- a/src/apps/rednatco/api.ts +++ b/src/apps/rednatco/api.ts @@ -15,7 +15,7 @@ export namespace ReDNATCOMspApi { } 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 function DeselectStep(): DeselectStep { @@ -36,7 +36,7 @@ export namespace ReDNATCOMspApi { prev?: 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 }; } @@ -51,7 +51,7 @@ export namespace ReDNATCOMspApi { Commands.SwitchModel; 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 function FilterApplied(): Filter { @@ -97,7 +97,7 @@ export namespace ReDNATCOMspApi { Events.StructureLoaded; 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 function CurrentFilter(filter: Filters.All): CurrentFilter { @@ -114,7 +114,7 @@ export namespace ReDNATCOMspApi { 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 = { 'current-filter': Queries.CurrentFilter, 'current-model-number': Queries.CurrentModelNumber, @@ -126,7 +126,7 @@ export namespace ReDNATCOMspApi { event: (evt: Event) => void; init: (elemId: string, onEvent?: (evt: Event) => void) => void; 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]; } } diff --git a/src/apps/rednatco/util.ts b/src/apps/rednatco/util.ts index d16a9cff9a1d4fe024735458e4122508f259f35a..e59f03a2a2f98fb0e62c993cdcb2e0ce2efd9944 100644 --- a/src/apps/rednatco/util.ts +++ b/src/apps/rednatco/util.ts @@ -68,7 +68,7 @@ export function reduceDecimals(s: string) { if (s.charCodeAt(idx) !== Zero) break; } - const noDot = s.charCodeAt(idx) === Period ? 0 : 1 + const noDot = s.charCodeAt(idx) === Period ? 0 : 1; return s.substring(0, idx + noDot); }