Browse documentation

IconsOptions

Type. Configuration for icon and manifest generation.

Table of contents

Category

Type

Type import

ts
import type { icons } from "valyrian.js/node";
type IconsOptions = NonNullable<Parameters<typeof icons>[1]>;

Public signature

ts
interface IconsOptions {
  iconsPath: string | null;
  linksViewPath: string | null;
  logging: boolean;
  path: string;
  appName?: string;
  appDescription?: string;
  developerName?: string;
  developerURL?: string;
  dir?: "auto" | "ltr" | "rtl" | string;
  lang?: string;
  background?: string;
  theme_color?: string;
  display?: "browser" | "standalone" | string;
  orientation?: "any" | "portrait" | "landscape" | string;
  start_url?: string;
  version?: string;
  icons: {
    android: boolean;
    appleIcon: boolean;
    appleStartup: boolean;
    coast: boolean;
    favicons: boolean;
    firefox: boolean;
    windows: boolean;
    yandex: boolean;
  };
}

Type usage

IconsOptions is the configuration accepted by icons(source, configuration). source is a file path string for the image or SVG used to generate assets.

Defaults

ts
iconsPath: null
linksViewPath: null
logging: false
path: ""
dir: "auto"
lang: "en-US"
background: "#fff"
theme_color: "#fff"
display: "standalone"
orientation: "any"
start_url: "/"
version: "1.0"
icons: {
  android: true,
  appleIcon: true,
  appleStartup: true,
  coast: false,
  favicons: true,
  firefox: false,
  windows: true,
  yandex: false,
}

Result

icons(...) returns Promise<void>. It writes selected generated images and manifest files under iconsPath, and writes links.js under linksViewPath when those paths are configured.