Chart.js/types/tests/parsed.data.type.ts
Dan Onoshko 2031cdf051
Preparing the project for TypeScript (#10595)
* Add Typescript to the build
* Converts the `helpers.core` to Typescript as an example
* Converts the `core.element` to Typescript
2022-08-22 11:58:57 -04:00

19 lines
460 B
TypeScript

import { ParsedDataType } from '../../src/types';
interface test {
pie: ParsedDataType<'pie'>,
line: ParsedDataType<'line'>,
testA: ParsedDataType<'pie' | 'line' | 'bar'>
testB: ParsedDataType<'pie' | 'line' | 'bar'>
testC: ParsedDataType<'pie' | 'line' | 'bar'>
}
const testImpl: test = {
pie: 1,
line: { x: 1, y: 2 },
testA: 1,
testB: { x: 1, y: 2 },
// @ts-expect-error testC should be limited to pie/line datatypes
testC: 'test'
};