vue-html-to-paper icon indicating copy to clipboard operation
vue-html-to-paper copied to clipboard

Typescript support

Open yzx9 opened this issue 5 years ago • 9 comments

close #12

yzx9 avatar Nov 19 '19 13:11 yzx9

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

yzx9 avatar Nov 20 '19 04:11 yzx9

@jofftiquez OK, I fixed it.

yzx9 avatar Feb 13 '20 13:02 yzx9

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

Hawxy avatar Jun 17 '20 04:06 Hawxy

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

thecoconutdream avatar May 06 '21 12:05 thecoconutdream

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.

jofftiquez avatar May 06 '21 13:05 jofftiquez

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

thecoconutdream avatar May 19 '21 14:05 thecoconutdream

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

yzx9 avatar May 23 '21 10:05 yzx9

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.

yzx9 avatar May 28 '21 02:05 yzx9

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

dennisp93 avatar Jul 05 '21 08:07 dennisp93

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

jofftiquez avatar Jun 09 '23 01:06 jofftiquez

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 avatar Jun 14 '23 11:06 yzx9

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

yzx9 avatar Jun 14 '23 12:06 yzx9

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.

jofftiquez avatar Jun 14 '23 14:06 jofftiquez