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

parse result should have more specific type #30

Closed
NullVoxPopuli opened this issue Sep 30, 2023 · 2 comments
Closed

parse result should have more specific type #30

NullVoxPopuli opened this issue Sep 30, 2023 · 2 comments

Comments

@NullVoxPopuli
Copy link
Contributor

right now the type is any. A better type might be something like:

interface ParseResult {
  type: "expression" | "class-member",
  tagName: "template",
  contents: string,
  range: {
    start: number,
    end: number,
  },
  contentRange: {
    start: number,
    end: number,
  },
  startRange: {
    end: number,
    start: number,
  },
  endRange: {
    start: number,
    end: number,
  },
}

// 
let result: ParseResult[] = p.parse(...);
@ef4
Copy link
Collaborator

ef4 commented Sep 30, 2023

There's a merged but unreleased PR in wasm-bindgen that would let us return Result<Vec<Occurence>, JsValue> directly across the wasm boundary. That would probably cause wasm-bindgen to also generate this type better.

@NullVoxPopuli
Copy link
Contributor Author

this is resolved as of 1.2.2

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

No branches or pull requests

2 participants