-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redo Typescript migration #133
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
93f87ae
to
50e5063
Compare
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
50e5063
to
184ea42
Compare
9ac95b7
to
0196912
Compare
Signed-off-by: Tristan Chuine <[email protected]>
Signed-off-by: Tristan Chuine <[email protected]>
0196912
to
5ad261c
Compare
e4b40df
to
718a99a
Compare
seem that tsc still check json now?... Signed-off-by: Tristan Chuine <[email protected]>
20a0137
to
c49289e
Compare
Quality Gate passedIssues Measures |
@@ -384,7 +446,7 @@ export class ArrowLayer extends Layer { | |||
.draw(); | |||
} | |||
|
|||
_getModel(gl) { | |||
_getModel(gl: ConstructorParameters<typeof Model>[0]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait utiliser ici WebGLRenderingContext ?
.setUniforms({ | ||
sizeMinPixels, | ||
sizeMaxPixels, | ||
linePositionsTexture, | ||
lineDistancesTexture, | ||
linePositionsTextureSize: [linePositionsTexture.width, linePositionsTexture.height], | ||
lineDistancesTextureSize: [lineDistancesTexture.width, lineDistancesTexture.height], | ||
// @ts-expect-error TODO TS2339: Properties width and height does not exists on type Texture2D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ici on ne passe pas opacity que l'on peut obtenir de this.props et qui fait pourtant bien parti des props de la layer.
this.state = { | ||
maxTextureSize, | ||
webgl2: isWebGL2(gl), | ||
}; | ||
|
||
this.getAttributeManager().addInstanced({ | ||
this.getAttributeManager()?.addInstanced({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait définir l'instanced attribute getProximityFactors comme Accessor dans les _ArrowLayerProps.
metaVoltageLevelsByNominalVoltage: MetaVoltageLevelsByNominalVoltage[]; | ||
}; | ||
|
||
initializeState(...args: Parameters<CompositeLayer<Required<_SubstationLayerProps>>['initializeState']>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A t'on vraiment besoin du spread et ne peut pas pas utiliser (context: LayerContext) comme dans la définition de super.initializeState ? Mais c'est peut être un mauvais typage de deck.gl ?
let factor = getDistance(firstPosition, secondPosition) / (3 * this.props.distanceBetweenLines); | ||
if (factor > 1) { | ||
factor = 1; | ||
} | ||
return factor; | ||
} | ||
|
||
computeAngle(props, position1, position2) { | ||
computeAngle(props: UpdateParameters<this>['props'], position1: LonLat, position2: LonLat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait utiliser this['props']
au lieu de UpdateParameters<this>['props']
.
linesStatus: Map<string, LinesStatus>; | ||
}; | ||
|
||
initializeState(...args: Parameters<CompositeLayer<Required<_LineLayerProps>>['initializeState']>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A t'on vraiment besoin du spread et ne peut pas pas utiliser (context: LayerContext)
comme dans la définition de super.initializeState
? Mais c'est peut être un mauvais typage de deck.gl ?
@@ -43,7 +65,7 @@ export class GeoData { | |||
.forEach((id) => this.substationPositionsById.delete(id)); | |||
} | |||
|
|||
getSubstationPosition(substationId) { | |||
getSubstationPosition(substationId: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait typer le retour en LonLat (par défaut c'est number[]).
@@ -72,7 +94,7 @@ export class GeoData { | |||
/** | |||
* Get line positions always ordered from side 1 to side 2. | |||
*/ | |||
getLinePositions(network, line, detailed = true) { | |||
getLinePositions(network: MapEquipments, line: MapAnyLine, detailed = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait typer le retour en LonLat[] (par défaut c'est any[]).
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
#131
What kind of change does this PR introduce?
Re-apply fixed types of #121, with minimal changes of code outside of types (lots of
@ts-ignore
as consequence).What is the current behavior?
Some classes & components in JS, and some .d.ts not in sync with JS.
What is the new behavior (if this is a feature change)?
All files migrated to TypeScript with the types fixed and unified.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
The migration steps are described in the following sectionWhat changes might users need to make in their application due to this PR? (migration steps)
The API is the same but the types has been updated.
Other information:
@danmarshall/deckgl-typings
has been added temporally, the migration to deck.gl v9 coming soon, and thepostinstall
script is to cancel the copy of files that thepostinstall
ofdeckgl-typings
is doing (copying files innode_modules/@types/
) because it conflict with deck.gl typing preview (look atdeckgl.d.ts
).