From 1f3b16e698c90824cff9a14262c3215224078d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Mal=C3=BD?= <michal.maly@ibt.cas.cz> Date: Mon, 16 Jan 2023 08:58:12 +0100 Subject: [PATCH] Linter --- src/apps/rednatco/api-impl.ts | 6 +++--- src/apps/rednatco/api.ts | 12 ++++++------ src/apps/rednatco/util.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/apps/rednatco/api-impl.ts b/src/apps/rednatco/api-impl.ts index d9940fa8a..bed5fbff2 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 09a30b75b..1652681da 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 d16a9cff9..e59f03a2a 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); } -- GitLab