forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(a2hs.js): new type definition (DefinitelyTyped#45502)
- definition file - tests https://github.com/koddr/a2hs.js#readme Thanks!
- Loading branch information
1 parent
620f06b
commit 1c238d7
Showing
4 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import AddToHomeScreen = require('a2hs.js'); | ||
|
||
AddToHomeScreen(); | ||
|
||
AddToHomeScreen({ | ||
backgroundColor: 'red', | ||
padding: '10px', | ||
shadowColor: '#e9e9e9', | ||
shadowSize: '10px', | ||
color: '#5d5d5d', | ||
brandName: 'Demo', | ||
fontFamily: 'Tahoma, sans-serif', | ||
fontSize: '0.9rem', | ||
logoImage: `<svg enable-background="new 0 0 1952.00 734.93" height="25" viewBox="0 0 1952 734.93" width="70" xmlns="http://www.w3.org/2000/svg">`, | ||
htmlContent: `Install <strong>{{brandName}} web app</strong> on your iOS device: tap share and <strong>Add to Home Screen</strong> ↓`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Type definitions for a2hs.js 0.4 | ||
// Project: https://github.io/koddr/a2hs.js | ||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
/** | ||
* A useful modern JavaScript solution for adding a progressive | ||
* web application (PWA) to the home screen of your mobile | ||
* iOS device. | ||
*/ | ||
declare function AddToHomeScreen(settings?: AddToHomeScreen.Settings): void; | ||
|
||
declare namespace AddToHomeScreen { | ||
interface Settings { | ||
/** | ||
* Background color for container | ||
* @default '#f9f9f9' | ||
*/ | ||
backgroundColor?: string; | ||
/** | ||
* Padding for container | ||
* @default '10px' | ||
*/ | ||
padding?: string; | ||
/** | ||
* Shadow color for top of container | ||
* @default '#e9e9e9' | ||
*/ | ||
shadowColor?: string; | ||
/** | ||
* Shadow size for top of container | ||
* @default '10px' | ||
*/ | ||
shadowSize?: string; | ||
/** | ||
* Font family for content in container | ||
* @default '-apple-system, sans-serif' | ||
*/ | ||
fontFamily?: string; | ||
/** | ||
* Font color for content in container | ||
* @default '#5d5d5d' | ||
*/ | ||
color?: string; | ||
/** | ||
* Font size for content in container | ||
* @default '0.9rem' | ||
*/ | ||
fontSize?: string; | ||
/** | ||
* Brand for default `htmlContent` | ||
* @default '' | ||
*/ | ||
brandName?: string; | ||
/** | ||
* Logo for container | ||
*/ | ||
logoImage?: string; | ||
/** | ||
* Content for container with HTML | ||
*/ | ||
htmlContent?: string; | ||
} | ||
} | ||
export = AddToHomeScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"baseUrl": "../", | ||
"typeRoots": [ | ||
"../" | ||
], | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"a2hs.js-tests.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |