index.js 917 B

12345678910111213141516171819202122
  1. import * as dfucs from "./extends/draw-function/index";
  2. import DrawPoster from "./draw-poster";
  3. import drawQrCode from "./extends/draw-qr-code/index";
  4. import createFromList from './extends/create-from-list/index';
  5. import drawPainter from './extends/draw-painter/index';
  6. DrawPoster.useCtx(dfucs.drawImage);
  7. DrawPoster.useCtx(dfucs.fillWarpText);
  8. DrawPoster.useCtx(dfucs.roundRect);
  9. DrawPoster.useCtx(dfucs.fillRoundRect);
  10. DrawPoster.useCtx(dfucs.strokeRoundRect);
  11. DrawPoster.useCtx(dfucs.drawRoundImage);
  12. DrawPoster.useCtx(dfucs.drawImageFit);
  13. const useDrawPoster = async (options) => {
  14. const dp = await DrawPoster.build(options);
  15. return dp;
  16. };
  17. const useDrawPosters = async (optionsAll) => {
  18. const dps = await DrawPoster.buildAll(optionsAll);
  19. return dps;
  20. };
  21. export { DrawPoster, useDrawPoster, useDrawPosters, drawQrCode, drawPainter, createFromList };
  22. export default DrawPoster;