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

An accessor cannot be declared in an ambient context. #4259

Closed
Tyriar opened this issue Nov 10, 2022 · 2 comments · Fixed by #4304
Closed

An accessor cannot be declared in an ambient context. #4259

Tyriar opened this issue Nov 10, 2022 · 2 comments · Fixed by #4304
Assignees
Labels
area/api type/bug Something is misbehaving
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Nov 10, 2022

I see this error when trying to update the website docs:

[07:24:34] /Users/daimms/dev/Tyriar/xtermjs.org/_xterm.js/typings/xterm.d.ts(711)
 An accessor cannot be declared in an ambient context.
[07:24:34] /Users/daimms/dev/Tyriar/xtermjs.org/_xterm.js/typings/xterm.d.ts(711)
 'get' and 'set' accessor must have the same type.
[07:24:34] /Users/daimms/dev/Tyriar/xtermjs.org/_xterm.js/typings/xterm.d.ts(729)
 An accessor cannot be declared in an ambient context.
[07:24:34] /Users/daimms/dev/Tyriar/xtermjs.org/_xterm.js/typings/xterm.d.ts(729)
 'get' and 'set' accessor must have the same type.
[07:24:34] 'typedoc' errored after 1.94 s
[07:24:34] Error in plugin "gulp-typedoc"
@Tyriar Tyriar added the type/bug Something is misbehaving label Nov 10, 2022
@Tyriar Tyriar added this to the 5.1.0 milestone Nov 10, 2022
@Tyriar Tyriar self-assigned this Nov 10, 2022
@silamon
Copy link
Contributor

silamon commented Nov 20, 2022

Quick view shows you may be able to solve it by bumping typedoc from 0.15.0 to 0.17.0.
I'll see if I can open a pull request.

The issue is being caused by the different types in set and get for options.

EDIT: Somehow it build docs for an old version.

@Tyriar
Copy link
Member Author

Tyriar commented Nov 20, 2022

It built with v5's version, but yeah we need to simplify the types by just moving to options: ITerminalOptions here and merging the comments:

xterm.js/typings/xterm.d.ts

Lines 703 to 729 in a351f57

/**
* Gets or sets the terminal options. This supports setting multiple options.
*
* @example Get a single option
* ```typescript
* console.log(terminal.options.fontSize);
* ```
*/
get options(): Required<ITerminalOptions>;
/**
* Gets or sets the terminal options. This supports setting multiple options.
*
* @example Set a single option
* ```typescript
* terminal.options.fontSize = 12;
* ```
*
* @example Set multiple options
* ```typescript
* terminal.options = {
* fontSize: 12,
* fontFamily: 'Arial',
* };
* ```
*/
set options(options: ITerminalOptions);

Tyriar added a commit to Tyriar/xterm.js that referenced this issue Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api type/bug Something is misbehaving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants