Skip to content

Commit

Permalink
fix: 🐛 Fix types inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-hemphill committed May 5, 2021
1 parent 96c2d68 commit 643eedc
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"build": "tsup src/index.ts --sourcemap --dts-resolve --format cjs,esm",
"build": "tsup src/index.ts --sourcemap --dts --format cjs,esm",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"lint": "run-s fix:*",
"lint:typescript": "eslint src --ext .ts --fix",
Expand Down
84 changes: 84 additions & 0 deletions src/faviconsTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
interface IconOptions {
offset?: number;
background?: boolean | string;
mask?: boolean;
overlayGlow?: boolean;
ovelayShadow?: boolean;
}

export interface FaviconOptions {
/** Path for overriding default icons path @default '/' */
path: string;
/** Your application's name @default null */
appName: string | null;
/**
* Your application's short_name.
* @default appName
*/
appShortName: string | null;
/** Your application's description @default null */
appDescription: string | null;
/** Your (or your developer's) name @default null */
developerName: string | null;
/** Your (or your developer's) URL @default null */
developerURL: string | null;
/** Primary text direction for name, short_name, and description @default 'auto' */
dir: string;
/** Primary language for name and short_name @default 'en-US' */
lang: string;
/** Background colour for flattened icons @default '#fff' */
background: string;
/** Theme color user for example in Android's task switcher @default '#fff' */
theme_color: string;
/** Style for Apple status bar @default 'black-translucent' */
appleStatusBarStyle: 'black-translucent' | 'default' | 'black';
/** Preferred display mode: 'fullscreen', 'standalone', 'minimal-ui' or 'browser' @default 'standalone' */
display: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser';
/** Default orientation: 'any', 'natural', 'portrait' or 'landscape' @default 'any' */
orientation: 'any' | 'natural' | 'portrait' | 'landscape';
/** Set of URLs that the browser considers within your app @default null */
scope: string;
/** Start URL when launching the application from a device @default '/?homescreen=1' */
start_url: string;
/** Your application's version string @default '1.0' */
version: string;
/** Print logs to console? @default false */
logging: boolean;
/** Determines whether to allow piping html as a file @default false */
pipeHTML: boolean;
/** Use nearest neighbor resampling to preserve hard edges on pixel art @default false */
pixel_art: boolean;
/** Browsers don't send cookies when fetching a manifest, enable this to fix that @default false */
loadManifestWithCredentials: boolean;
/** Determines whether to set relative paths in manifests @default false */
manifestRelativePaths: boolean;
/**
* Platform Options:
* - offset - offset in percentage
* - background:
* * false - use default
* * true - force use default, e.g. set background for Android icons
* * color - set background for the specified icons
* - mask - apply mask in order to create circle icon (applied by default for firefox)
* - overlayGlow - apply glow effect after mask has been applied (applied by default for firefox)
* - overlayShadow - apply drop shadow after mask has been applied
*/
icons: Partial<{
/* Create Android homescreen icon. */
android: boolean | IconOptions | string[];
/* Create Apple touch icons. */
appleIcon: boolean | IconOptions | string[];
/* Create Apple startup images. */
appleStartup: boolean | IconOptions | string[];
/* Create Opera Coast icon. */
coast: boolean | IconOptions | string[];
/* Create regular favicons. */
favicons: boolean | IconOptions | string[];
/* Create Firefox OS icons. */
firefox: boolean | IconOptions | string[];
/* Create Windows 8 tile icons. */
windows: boolean | IconOptions | string[];
/* Create Yandex browser icon. */
yandex: boolean | IconOptions | string[];
}>;
}
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import Oracle from './oracle.js';
import path from 'path';
import { getDefaultFaviconConfig } from './faviconsDefaults.js';
import { parseFragment } from 'parse5';
import type { FaviconOptions } from './faviconsTypes.js';

type FaviconsConfig = Partial<favicons.FaviconOptions>
type FaviconsConfig = Partial<FaviconOptions>
export type ViteFaviconsPluginOptions = {
/** Your source logo (Will default to )
@default "assets/logo.png"
Expand Down

0 comments on commit 643eedc

Please sign in to comment.