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

Add rest of keyboard bindings #10

Merged
merged 1 commit into from Feb 27, 2018

Conversation

Projects
None yet
1 participant
@zploskey
Copy link
Owner

zploskey commented Feb 24, 2018

No description provided.

@zploskey

This comment has been minimized.

Copy link
Owner Author

zploskey commented Feb 24, 2018

I've initially written these to share a set of configuration options, but some functions only use a subset. The typescript definitions are:

down(key: string, options?: { text?: string }): Promise<void>;
press(key: string, options?: { text?: string, delay?: number }): Promise<void>;
sendCharacter(char: string): Promise<void>;
type(text: string, options?: { delay?: number }): Promise<void>;

Passing extra keys does not matter (at least in the current implementation at Puppeteer 1.1.1). This lets us get away with fewer types, but we could more tightly constrain the types on options for down and type_. I'd rather not make separate special creation functions for each variation of these options objects. We could get away with not allowing the keys to be optional for the ones with only one key and just provide the type inline in the external.

@zploskey zploskey merged commit 1e0ae8b into master Feb 27, 2018

@zploskey zploskey deleted the keyboard branch Feb 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment