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

Typescript support #30

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Typescript support #30

merged 1 commit into from
Jun 14, 2023

Conversation

yzx9
Copy link
Contributor

@yzx9 yzx9 commented Nov 19, 2019

close #12

@yzx9
Copy link
Contributor Author

yzx9 commented Nov 20, 2019

Not compatible for #28 #29 now, but it's easy to do.

index.d.ts Outdated Show resolved Hide resolved
@yzx9
Copy link
Contributor Author

yzx9 commented Feb 13, 2020

@jofftiquez OK, I fixed it.

@Hawxy
Copy link

Hawxy commented Jun 17, 2020

@jofftiquez Are these PRs going to be merged in any time soon? They're all a good bump in this package's usability.

@thecoconutdream
Copy link

@jofftiquez is there a chance that you still merge this PR? Would be awesome!

@jofftiquez
Copy link
Member

Hi @thecoconutdream @Hawxy I'm just waiting for the PR author to fix the conflicts otherwise I'll implement it myself. Just a few more days.Thank you for reminding me.

@thecoconutdream
Copy link

@jofftiquez Hey, thanks for the reply :) Any news?

@yzx9
Copy link
Contributor Author

yzx9 commented May 23, 2021

@jofftiquez sorry for delay, I can certainly fix the conflict if it still needed.

@yzx9 yzx9 requested a review from jofftiquez May 28, 2021 02:48
@yzx9
Copy link
Contributor Author

yzx9 commented May 28, 2021

Too many files changed but not mentioned in this PR and it is not easy to review, I can reopen a PR to facilitate review if needed.

@dennisp93
Copy link

Hi @nsznsznjsz @jofftiquez :) Any updates when the merge will happen? :)

@jofftiquez
Copy link
Member

Sorry about the super late reply, @yzx9. Any chance you can update the PR for the latest version? Thanks

@yzx9
Copy link
Contributor Author

yzx9 commented Jun 14, 2023

Sorry about the super late reply, @yzx9. Any chance you can update the PR for the latest version? Thanks

Yes, I would still like to update. I'll push an update later.

@yzx9
Copy link
Contributor Author

yzx9 commented Jun 14, 2023

I forced push an update to make this PR clear again.

Type definition was defined in types/index.d.ts, and enabled by types field in package.json.

The current code is for Vue3, if you want to support the Vue2, please change the following code:

import { Plugin } from "vue"
declare module "vue" {
  interface ComponentCustomProperties {
    $htmlToPaper: HtmlToPaper
  }
}

to

import { PluginFunction } from "vue"
declare module "vue/types/vue" {
  interface Vue {
    $htmlToPaper: HtmlToPaper
  }
}

Or add a dependency vue-demi, and declare both module.

BTW, I added files field to reduce user install size, more info available at: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files

@jofftiquez
Copy link
Member

I forced push an update to make this PR clear again.

Type definition was defined in types/index.d.ts, and enabled by types field in package.json.

The current code is for Vue3, if you want to support the Vue2, please change the following code:

import { Plugin } from "vue"
declare module "vue" {
  interface ComponentCustomProperties {
    $htmlToPaper: HtmlToPaper
  }
}

to

import { PluginFunction } from "vue"
declare module "vue/types/vue" {
  interface Vue {
    $htmlToPaper: HtmlToPaper
  }
}

Or add a dependency vue-demi, and declare both module.

BTW, I added files field to reduce user install size, more info available at: docs.npmjs.com/cli/v9/configuring-npm/package-json#files

IDK if there's still need to add this to vue 2 version but feel free to make a PR to https://github.com/mycurelabs/vue-html-to-paper/tree/v1. Thank you so much for this.

Copy link
Member

@jofftiquez jofftiquez left a comment

Choose a reason for hiding this comment

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

This looks good. Thank you!

@jofftiquez jofftiquez merged commit e92a30d into mycurelabs:master Jun 14, 2023
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.

Use vue-html-to-paper with typescript
5 participants