Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
a9d20c7e
Commit
a9d20c7e
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
mol-state: generic StateObjectCell
parent
fc90ee91
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-state/object.ts
+2
-2
2 additions, 2 deletions
src/mol-state/object.ts
src/mol-state/state/selection.ts
+1
-1
1 addition, 1 deletion
src/mol-state/state/selection.ts
src/mol-state/transformer.ts
+2
-1
2 additions, 1 deletion
src/mol-state/transformer.ts
with
5 additions
and
4 deletions
src/mol-state/object.ts
+
2
−
2
View file @
a9d20c7e
...
...
@@ -53,7 +53,7 @@ namespace StateObject {
};
}
interface
StateObjectCell
{
interface
StateObjectCell
<
T
=
StateObject
>
{
transform
:
Transform
,
// Which object was used as a parent to create data in this cell
...
...
@@ -68,7 +68,7 @@ interface StateObjectCell {
}
|
undefined
;
errorText
?:
string
,
obj
?:
StateObject
obj
?:
T
}
namespace
StateObjectCell
{
...
...
This diff is collapsed.
Click to expand it.
src/mol-state/state/selection.ts
+
1
−
1
View file @
a9d20c7e
...
...
@@ -29,7 +29,7 @@ namespace StateSelection {
}
function
isObj
(
arg
:
any
):
arg
is
StateObjectCell
{
return
(
arg
as
StateObjectCell
).
version
!==
void
0
;
return
(
arg
as
StateObjectCell
).
version
!==
void
0
&&
(
arg
as
StateObjectCell
).
transform
!==
void
0
;
}
function
isBuilder
(
arg
:
any
):
arg
is
Builder
{
...
...
This diff is collapsed.
Click to expand it.
src/mol-state/transformer.ts
+
2
−
1
View file @
a9d20c7e
...
...
@@ -5,7 +5,7 @@
*/
import
{
Task
}
from
'
mol-task
'
;
import
{
StateObject
}
from
'
./object
'
;
import
{
StateObject
,
StateObjectCell
}
from
'
./object
'
;
import
{
Transform
}
from
'
./transform
'
;
import
{
ParamDefinition
as
PD
}
from
'
mol-util/param-definition
'
;
import
{
StateAction
}
from
'
./action
'
;
...
...
@@ -24,6 +24,7 @@ export namespace Transformer {
export
type
Params
<
T
extends
Transformer
<
any
,
any
,
any
>>
=
T
extends
Transformer
<
any
,
any
,
infer
P
>
?
P
:
unknown
;
export
type
From
<
T
extends
Transformer
<
any
,
any
,
any
>>
=
T
extends
Transformer
<
infer
A
,
any
,
any
>
?
A
:
unknown
;
export
type
To
<
T
extends
Transformer
<
any
,
any
,
any
>>
=
T
extends
Transformer
<
any
,
infer
B
,
any
>
?
B
:
unknown
;
export
type
Cell
<
T
extends
Transformer
<
any
,
any
,
any
>>
=
T
extends
Transformer
<
any
,
infer
B
,
any
>
?
StateObjectCell
<
B
>
:
unknown
;
export
function
is
(
obj
:
any
):
obj
is
Transformer
{
return
!!
obj
&&
typeof
(
obj
as
Transformer
).
toAction
===
'
function
'
&&
typeof
(
obj
as
Transformer
).
apply
===
'
function
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment