Skip to content
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

TypeScript: wrong type for chart.print() #53

Closed
KEIII opened this issue Aug 30, 2018 · 5 comments
Closed

TypeScript: wrong type for chart.print() #53

KEIII opened this issue Aug 30, 2018 · 5 comments
Assignees

Comments

@KEIII
Copy link

KEIII commented Aug 30, 2018

anychart.charts.Cartesian.print requires paperSize of anychart.graphics.vector.PaperSize
but doc says it must be a string.

Example:

chart.print('A4', true); // error TS2345: Argument of type '"A4"' is not assignable to parameter of type 'PaperSize | undefined'.

It seems PaperSize should be

enum PaperSize {
  A0 = 'A0',
  A1 = 'A1',
  // ...
}
@KEIII KEIII changed the title wrong type for chart.print() TypeScript: wrong type for chart.print() Aug 30, 2018
@Shestac92 Shestac92 self-assigned this Aug 31, 2018
@Shestac92
Copy link

@KEIII
The latest version of index.d.ts and AnyChart binaries (8.3.0) supports chart.print('A4', true); in TypeScript. Please, update your binaries up to the latest version and try to compile your project. it should work properly.

@KEIII
Copy link
Author

KEIII commented Aug 31, 2018

I'm on 8.3.0.
TS version 2.9.2 with config

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "strict": true,
    "strictPropertyInitialization": false,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

@Shestac92
Copy link

@KEIII
It seems there is a difference in index.d.ts between the latest version and version you are using.
Please, can you share with us the index.d.ts file to identify the version?

@KEIII
Copy link
Author

KEIII commented Sep 3, 2018

@Shestac92
Copy link

@KEIII
Yes, this is the latest version of index.d.ts and it should work properly.
Please, can you share with us the configuration? We'd like to reproduce the issue using your chart config.

@sturdystablestalwart sturdystablestalwart closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants