-
Notifications
You must be signed in to change notification settings - Fork 1
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
PDF Generator #23
base: master
Are you sure you want to change the base?
PDF Generator #23
Conversation
@@ -0,0 +1,14 @@ | |||
import * as hbs from "handlebars" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
czy tak nie zadziała?
import * as hbs from "handlebars" | |
import hbs from "handlebars" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
może handlebars
będzie jednak lepszą opcja niż skrótowiec, zwłaszcza że użyte jest tylko raz a łatwiej ogarnąć w kodzie że chodzi o handlebars
hbs nie wiele mówi :)
@@ -0,0 +1,14 @@ | |||
import * as hbs from "handlebars" | |||
import fs from "fs-extra" | |||
import * as path from "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
czy tak nie zadziała?
import * as path from "path" | |
import path from "path" |
import fs from "fs-extra" | ||
import * as path from "path" | ||
|
||
const compileHBStoHTML = async (templateName: Handlebars.Template, data: any): Promise<string> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compiletHandlebarstoHTML, co o tym myślisz?
src/utils/PdfGenerator/PdfPrinter.ts
Outdated
@@ -0,0 +1,23 @@ | |||
import * as puppeteer from "puppeteer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
czy jest jakiś powód dla takiej formy importów? :)
Add Ticket interface
import path from "path" | ||
import ITicketData from "./TicketData.inteface"; | ||
|
||
const compileHandlebarsToHTML = async (templateName: Handlebars.Template, data: ITicketData): Promise<string> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nazwij plik tak jak nazwa funkcji
@@ -0,0 +1,23 @@ | |||
import puppeteer from "puppeteer" | |||
|
|||
const PdfPrinter = async (HTMLToPrint: any): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nazwa funkcji i pliku z małej litery. Przyjęło się, że pierwsza duża litera jest zarezerwowana dla klas, typów, interfejsów
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tu stringa przekazujesz, nie any
No description provided.