CesiumGS / CesiumGS/cesium

Knockout not exported from Cesium.d.ts

Open
#12,423 1 comment 1 reaction 0 assignees View on GitHub
category - typescript type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### What happened?

`knockout` is exported from `Cesium.js`, but there is no matching export within `Cesium.d.ts`. Therefore there is no obvious type-safe way to access knockout functionality, such as subscribing to observables within view models.

The work around is to disable typescript checking of the relevant line:

```
// @ts-ignore
import { knockout as ko } from 'cesium';
```

TS type definitions exist for both knockout-es5 and knockout:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/knockout.es5/index.d.ts
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/knockout/index.d.ts

### Environment

CesiumJS Version: 1.123.1

Contributor guide

Open the contributing guide

Research direction

Compare the export in Cesium.js with the declarations in Cesium.d.ts, then review the linked Knockout type definitions for the expected typing. Verify that a TypeScript consumer can import knockout from cesium without @ts-ignore and access its observable functionality type-safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.