diff --git a/CHANGELOG.md b/CHANGELOG.md index f453d52fff..6e71e23526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # G2 - Changelog +## [5.0.20](https://github.com/antvis/g2/compare/5.0.19...5.0.20) (2023-08-17) + +### Bug Fixes + +- **interaction:** multi interaction ([#5419](https://github.com/antvis/g2/issues/5419)) ([328aeea](https://github.com/antvis/g2/commit/328aeeac34e770ff2c28f5b1a8ad704ab00af0a5)) +- **types:** add types for Chart interface ([acd81b9](https://github.com/antvis/g2/commit/acd81b93facc110015a38922e766a1fe5d7f9069)) + ## [5.0.19](https://github.com/antvis/g2/compare/5.0.18...5.0.19) (2023-08-15) ### Bug Fixes diff --git a/package.json b/package.json index 7973aedd81..2ad6707919 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g2", - "version": "5.0.19", + "version": "5.0.20", "description": "the Grammar of Graphics in Javascript", "license": "MIT", "main": "lib/index.js", diff --git a/site/package.json b/site/package.json index b9910c2fe1..62c5477054 100644 --- a/site/package.json +++ b/site/package.json @@ -1,5 +1,5 @@ { - "version": "5.0.19", + "version": "5.0.20", "scripts": { "start": "dumi dev", "build": "dumi build", diff --git a/src/api/chart.ts b/src/api/chart.ts index e8a7dd77dc..91d424dc7a 100644 --- a/src/api/chart.ts +++ b/src/api/chart.ts @@ -1,8 +1,8 @@ -import { extend } from './extend'; +import { G2Spec } from '../spec'; +import { extend, API } from './extend'; import { library } from './library'; import { Runtime } from './runtime'; -// Use a empty interface to mark Chart both a value and a class type. -export interface Chart {} +export interface Chart extends API {} export const Chart = extend(Runtime, library); diff --git a/src/api/extend.ts b/src/api/extend.ts index e9492d45ac..ea93f2c1b4 100644 --- a/src/api/extend.ts +++ b/src/api/extend.ts @@ -16,15 +16,17 @@ type CompositionOf = Of< CompositionOf >; +export type API = Runtime & + MarkOf MarkNode> & + CompositionOf; + export function extend< Spec extends G2Spec = G2Spec, Library extends G2Library = G2Library, >( Runtime: new (options: RuntimeOptions) => Runtime, library: Library, -): new (options?: RuntimeOptions) => Runtime & - MarkOf MarkNode> & - CompositionOf { +): new (options?: RuntimeOptions) => API { class Chart extends Runtime { constructor(options: Omit) { super({ ...options, lib: library });