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

Export PEX type directly #336

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Export PEX type directly #336

merged 2 commits into from
Dec 6, 2023

Conversation

kirahsapong
Copy link
Contributor

This PR exports the sphereon PresentationDefinitionV2 type directly, instead of a type alias, to resolve a TS issue inferring the type in consuming packages, where xyz should be of type PresentationDefinitionV2:

The inferred type of 'xyz' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@sphereon/pex-models'. This is likely not portable. A type annotation is necessary.

See here for further discussion

Copy link

codesandbox bot commented Dec 6, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented Dec 6, 2023

TBDocs Report

✅ No errors or warnings

@web5/api

  • Project entry file: packages/api/src/index.ts

TBDocs Report Updated at 2023-12-06T17:16:19Z 6308e9b

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #336 (6308e9b) into main (8e3c8ee) will increase coverage by 0.47%.
Report is 6 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #336      +/-   ##
==========================================
+ Coverage   92.23%   92.71%   +0.47%     
==========================================
  Files          75       75              
  Lines       16771    16787      +16     
  Branches     1567     1575       +8     
==========================================
+ Hits        15469    15564      +95     
+ Misses       1276     1197      -79     
  Partials       26       26              
Components Coverage Δ
api 96.94% <ø> (ø)
common 97.78% <ø> (ø)
credentials 94.32% <100.00%> (+<0.01%) ⬆️
crypto 100.00% <ø> (ø)
dids 91.80% <ø> (+3.34%) ⬆️
agent 88.08% <ø> (ø)
identity-agent 56.81% <ø> (ø)
proxy-agent 58.43% <ø> (ø)
user-agent 55.22% <ø> (ø)

@nitro-neal
Copy link
Contributor

I dont understand why typescript is doing this..

Chad says we can also try this:

export interface PresentationDefinitionV2 extends PexPresDefV2 {
    // Add any additional properties or methods if needed, or leave it empty
}

Copy link
Contributor

@nitro-neal nitro-neal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible can we try this first? As it will look -more- uniform for the rest of the code.

export interface PresentationDefinitionV2 extends PexPresDefV2 { }

and in the future we may change all exports to look like this

@nitro-neal nitro-neal merged commit 96ff737 into main Dec 6, 2023
29 checks passed
@nitro-neal nitro-neal deleted the feat/pex-type-export branch December 6, 2023 18:00
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* Export pex type directly

* Extend and export sphereon type
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* Export pex type directly

* Extend and export sphereon type
finn-tbd pushed a commit that referenced this pull request Mar 19, 2024
* Export pex type directly

* Extend and export sphereon type
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 this pull request may close these issues.

4 participants