Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@html-css-to-image/client",
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"description": "Lightweight TypeScript client for the HTML/CSS to Image API. Generate images from HTML/CSS, URLs, or templates in your TypeScript or JavaScript projects.",
"main": "dist/index.js",
Expand Down
22 changes: 21 additions & 1 deletion src/types/internals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ColorSchemeType} from "./request.js";
import {ColorSchemeType, MediaType} from "./request.js";

export abstract class BaseCreateRequestWithoutVariableOptions {
/**
Expand Down Expand Up @@ -61,6 +61,26 @@ export abstract class BaseCreateRequestWithoutVariableOptions {
*/
timezone?: string;

/**
Sets a value indicating whether the viewport should be rendered as if it's being viewed from a mobile device.
*/
viewport_mobile?: boolean;

/**
Sets a value indicating whether touch interactions are enabled within the viewport.
*/
viewport_touch?: boolean;

/**
* sets a value indicating whether the viewport should be in landscape orientation.
*/
viewport_landscape?: boolean;

/**
* Sets the media type to use for rendering, 'print' or 'screen'.
*/
media_type?: MediaType;

constructor(init?: Partial<BaseCreateRequestWithoutVariableOptions>) {
Object.assign(this, init);
}
Expand Down
1 change: 1 addition & 0 deletions src/types/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {BaseCreateRequestWithoutVariableOptions, BasePDFOptions} from "./interna

export type ColorSchemeType = 'light' | 'dark';
export type PdfUnit = 'px' | 'in' | 'cm' | 'mm';
export type MediaType = 'print' | 'screen';

export interface PdfValueWithUnits {
value: number;
Expand Down