diff --git a/src/extensions/zenodo/ui.tsx b/src/extensions/zenodo/ui.tsx index 7a4ad4a1620d55ed9828c55301f346d2ee8d5403..6a52228492df8971a3bded83c62793f1b0dcea62 100644 --- a/src/extensions/zenodo/ui.tsx +++ b/src/extensions/zenodo/ui.tsx @@ -202,7 +202,7 @@ export class ZenodoImportUI extends CollapsableControls<{}, State> { })); } else if (t.name === 'trajectory') { const [topologyUrl, topologyFormat, topologyIsBinary] = t.params.topology.split('|'); - const [coordinatesUrl, coordinatesFormat, coordinatesIsBinary] = t.params.coordinates.split('|'); + const [coordinatesUrl, coordinatesFormat] = t.params.coordinates.split('|'); await this.plugin.runTask(this.plugin.state.data.applyAction(LoadTrajectory, { source: { @@ -216,7 +216,6 @@ export class ZenodoImportUI extends CollapsableControls<{}, State> { coordinates: { url: coordinatesUrl, format: coordinatesFormat as any, - isBinary: coordinatesIsBinary === 'true', }, } } diff --git a/src/mol-gl/_spec/gl.shim.ts b/src/mol-gl/_spec/gl.shim.ts index 5c07826ac49b6cf8369fa7f5ceba357164ad3a8e..55ee986271726e763a6121b738627593b8df191a 100644 --- a/src/mol-gl/_spec/gl.shim.ts +++ b/src/mol-gl/_spec/gl.shim.ts @@ -16,7 +16,7 @@ const c = { MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84FF, MAX_TEXTURE_IMAGE_UNITS_NV: 0x8872 -}; +} as const; const gl = { ACTIVE_ATTRIBUTES: 35721, @@ -316,7 +316,7 @@ const gl = { VERTEX_SHADER: 35633, VIEWPORT: 2978, ZERO: 0 -}; +} as const; type gl = typeof gl export function createGl(width: number, height: number, contextAttributes: WebGLContextAttributes): WebGLRenderingContext { @@ -371,66 +371,66 @@ export function createGl(width: number, height: number, contextAttributes: WebGL case 'EXT_blend_minmax': return { MAX_EXT: 0, MIN_EXT: 0 - } as EXT_blend_minmax; + } as unknown as EXT_blend_minmax; case 'EXT_texture_filter_anisotropic': return { MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0, TEXTURE_MAX_ANISOTROPY_EXT: 0 - } as EXT_texture_filter_anisotropic; + } as unknown as EXT_texture_filter_anisotropic; case 'EXT_frag_depth': return {} as EXT_frag_depth; - case 'EXT_shader_texture_lod': return {} as EXT_shader_texture_lod; + case 'EXT_shader_texture_lod': return {} as unknown as EXT_shader_texture_lod; case 'EXT_sRGB': return { FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 0, SRGB8_ALPHA8_EXT: 0, SRGB_ALPHA_EXT: 0, SRGB_EXT: 0 - } as EXT_sRGB; + } as unknown as EXT_sRGB; case 'OES_vertex_array_object': return { VERTEX_ARRAY_BINDING_OES: 0, bindVertexArrayOES: function (arrayObject: WebGLVertexArrayObjectOES) { }, createVertexArrayOES: function (): WebGLVertexArrayObjectOES { return {}; }, deleteVertexArrayOES: function (arrayObject: WebGLVertexArrayObjectOES) { }, isVertexArrayOES: function (value: any) { return true; } - } as OES_vertex_array_object; + } as unknown as OES_vertex_array_object; case 'WEBGL_color_buffer_float': return { FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0, RGB32F_EXT: 0, RGBA32F_EXT: 0, UNSIGNED_NORMALIZED_EXT: 0 - } as WEBGL_color_buffer_float; + } as unknown as WEBGL_color_buffer_float; case 'WEBGL_compressed_texture_astc': return null; case 'WEBGL_compressed_texture_s3tc_srgb': return null; case 'WEBGL_debug_shaders': return { getTranslatedShaderSource(shader: WebGLShader) { return ''; } - } as WEBGL_debug_shaders; + } as unknown as WEBGL_debug_shaders; case 'WEBGL_draw_buffers': return null; case 'WEBGL_lose_context': return { loseContext: function () { }, restoreContext: function () { }, - } as WEBGL_lose_context; + } as unknown as WEBGL_lose_context; case 'WEBGL_depth_texture': return { UNSIGNED_INT_24_8_WEBGL: 0 - } as WEBGL_depth_texture; + } as unknown as WEBGL_depth_texture; case 'WEBGL_debug_renderer_info': return { UNMASKED_RENDERER_WEBGL: 0, UNMASKED_VENDOR_WEBGL: 0 - } as WEBGL_debug_renderer_info; + } as unknown as WEBGL_debug_renderer_info; case 'WEBGL_compressed_texture_s3tc': return null; - case 'OES_texture_half_float_linear': return {} as OES_texture_half_float_linear; + case 'OES_texture_half_float_linear': return {} as unknown as OES_texture_half_float_linear; case 'OES_texture_half_float': return { HALF_FLOAT_OES: 0 - } as OES_texture_half_float; - case 'OES_texture_float_linear': return {} as OES_texture_float_linear; - case 'OES_texture_float': return {} as OES_texture_float; + } as unknown as OES_texture_half_float; + case 'OES_texture_float_linear': return {} as unknown as OES_texture_float_linear; + case 'OES_texture_float': return {} as unknown as OES_texture_float; case 'OES_standard_derivatives': return { FRAGMENT_SHADER_DERIVATIVE_HINT_OES: 0 - } as OES_standard_derivatives; - case 'OES_element_index_uint': return {} as OES_element_index_uint; + } as unknown as OES_standard_derivatives; + case 'OES_element_index_uint': return {} as unknown as OES_element_index_uint; case 'ANGLE_instanced_arrays': return { drawArraysInstancedANGLE: function (mode: number, first: number, count: number, primcount: number) {}, drawElementsInstancedANGLE: function (mode: number, count: number, type: number, offset: number, primcount: number) {}, vertexAttribDivisorANGLE: function (index: number, divisor: number) {}, VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0 - } as ANGLE_instanced_arrays; + } as unknown as ANGLE_instanced_arrays; } return null; }, diff --git a/src/mol-plugin-state/transforms/data.ts b/src/mol-plugin-state/transforms/data.ts index 0a45868821867087e60809a2670fc9000f30a312..4e264c4e0c46ee91136e74e20e91ec0a11d88312 100644 --- a/src/mol-plugin-state/transforms/data.ts +++ b/src/mol-plugin-state/transforms/data.ts @@ -282,7 +282,7 @@ const ParseCif = PluginStateTransform.BuiltIn({ })({ apply({ a }) { return Task.create('Parse CIF', async ctx => { - const parsed = await (SO.Data.String.is(a) ? CIF.parse(a.data) : CIF.parseBinary(a.data)).runInContext(ctx); + const parsed = await (typeof a.data === 'string' ? CIF.parse(a.data) : CIF.parseBinary(a.data)).runInContext(ctx); if (parsed.isError) throw new Error(parsed.message); return new SO.Format.Cif(parsed.result); }); diff --git a/src/mol-plugin-ui/controls/slider.tsx b/src/mol-plugin-ui/controls/slider.tsx index 02c16b34a966c11c7dd748b7c2b4df86a24d392e..5fdc7ada4d25a9627cb962a1464eadf44da19bb0 100644 --- a/src/mol-plugin-ui/controls/slider.tsx +++ b/src/mol-plugin-ui/controls/slider.tsx @@ -626,9 +626,9 @@ export class SliderBase extends React.Component<SliderBaseProps, SliderBaseState const value = bounds[handle]; let direction = 0; - if (bounds[handle + 1] - value < threshold!) { + if (bounds[handle + 1] - value < +threshold!) { direction = +1; - } else if (value - bounds[handle - 1] < threshold!) { + } else if (value - bounds[handle - 1] < +threshold!) { direction = -1; } diff --git a/src/mol-state/object.ts b/src/mol-state/object.ts index fff4c7a1aa4f87ac74dac8f5184a64ddd703ce6b..a72b2b75c4671fea81e5423f8c409849c8572649 100644 --- a/src/mol-state/object.ts +++ b/src/mol-state/object.ts @@ -35,7 +35,7 @@ namespace StateObject { export function create<Data, T extends Type>(type: T) { return class O implements StateObject<Data, T> { static type = type; - static is(obj?: StateObject): obj is O { return !!obj && type === obj.type; } + static is(obj?: StateObject): obj is StateObject<Data, T> { return !!obj && type === obj.type; } id = UUID.create22(); type = type; label: string;