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] Export GetSet types to the outside world. #1672

Open
StringKe opened this issue Nov 20, 2023 · 0 comments
Open

[Typescript] Export GetSet types to the outside world. #1672

StringKe opened this issue Nov 20, 2023 · 0 comments

Comments

@StringKe
Copy link

StringKe commented Nov 20, 2023

There are currently no externally exported GetSet types. I need to use it to refine my overall type definition.

Validators and Factory and GetSet need to be exported.

import Konva from 'konva';

import { type ArtboardConfigWithDefault } from '../types';

export declare type ArtboardConfig = {
    artboard: ArtboardConfigWithDefault;
} & Konva.StageConfig;

export class ArtboardStage extends Konva.Stage {
    artboard: Konva.GetSet<ArtboardConfigWithDefault, this>;
    
    constructor(config: ArtboardConfig) {
        super(config);
    }
}

Konva.Factory.addGetterSetter(ArtboardStage, 'artboard', {
    wdith: 800,h eight:600
});
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

Successfully merging a pull request may close this issue.

1 participant