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

Error in types.d.ts TypeScript definitions #968

Closed
viperet opened this issue Jul 3, 2022 · 0 comments · Fixed by #980
Closed

Error in types.d.ts TypeScript definitions #968

viperet opened this issue Jul 3, 2022 · 0 comments · Fixed by #980

Comments

@viperet
Copy link

viperet commented Jul 3, 2022

php-parser version 3.1.0-beta.11
tsc version 4.7.4

node_modules/php-parser/types.d.ts:327:9 - error TS2416: Property 'value' in type 'Encapsed' is not assignable to the same property in base type 'Literal'.
  Type 'EncapsedPart[]' is not assignable to type 'string | number | boolean | Node | null'.

327         value: EncapsedPart[];
            ~~~~~


Found 1 error in node_modules/php-parser/types.d.ts:327

Possible solution: extend Encapsed class directly from Expression and add raw: string; directly to Encapsed class.

ytetsuro added a commit to ytetsuro/php-parser that referenced this issue Jul 31, 2022
czosel pushed a commit that referenced this issue Aug 9, 2022
* docs: Modified jsdoc to be as per current types.d.ts.

* A little processing has been added so that TokenNames are defined as constants.
* NullSafePropertyLookup has renamed its constructor.

* docs: npm run build-types

* docs: fix typo, and define type.

* chore: add type check in github actions.

* chore: npm run test -- --updateSnapshot

* chore: add diff check for types.d.ts.

* docs: fix style.
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