introducing MailgoConfig

This commit is contained in:
Matteo Manzinello 2020-04-25 17:24:28 +02:00
parent 1eba37acce
commit eb2e4bb9db
3 changed files with 12 additions and 8 deletions

7
index.d.ts vendored
View File

@ -1,7 +0,0 @@
// Type definitions for mailgo
// Project: mailgo
// Definitions by: Matteo Manzinello <https://matteomanzinello.com>
export as namespace Mailgo;
export function mailgo(mailgoConfig?: any): void;

9
mailgo.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for mailgo
// Project: mailgo
// Definitions by: Matteo Manzinello <https://matteomanzinello.com>
export type MailgoConfig = {
initEvent?: string;
};
export default function mailgo(mailgoConfig?: MailgoConfig): void;

View File

@ -1,3 +1,5 @@
import { MailgoConfig } from "../mailgo";
// links // links
const MAILTO: string = "mailto:"; const MAILTO: string = "mailto:";
const TEL: string = "tel:"; const TEL: string = "tel:";
@ -830,7 +832,7 @@ const mailgoStyle = (): void => {
}; };
// mailgo // mailgo
const mailgo = (mailgoConfig?: any): void => { const mailgo = (mailgoConfig?: MailgoConfig): void => {
// if the window is defined... // if the window is defined...
if (window && typeof window !== "undefined") { if (window && typeof window !== "undefined") {
// add the style for mailgo // add the style for mailgo