Skip to content

Commit 2ffa89b

Browse files
added: types
1 parent 47bd744 commit 2ffa89b

File tree

6 files changed

+3294
-685
lines changed

6 files changed

+3294
-685
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [12.x, 14.x, 15.x, 16.x]
17+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Local Unit Test ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- run: npm ci
26+
- run: npm test

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,13 @@ loadImages($('img', '.main-content'))
5858
})
5959
```
6060

61-
[travis-image]: https://img.shields.io/travis/biancojs/images-loader.svg?style=flat-square
62-
63-
[travis-url]: https://travis-ci.org/biancojs/images-loader
61+
[ci-image]:https://img.shields.io/github/workflow/status/biancojs/images-loader/test?style=flat-square
62+
[ci-url]:https://github.com/biancojs/images-loader/actions
6463

6564
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
66-
6765
[license-url]: LICENSE.txt
6866

6967
[npm-version-image]: http://img.shields.io/npm/v/bianco.images-loader.svg?style=flat-square
70-
7168
[npm-downloads-image]: http://img.shields.io/npm/dm/bianco.images-loader.svg?style=flat-square
7269

7370
[npm-url]: https://npmjs.org/package/bianco.images-loader

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type LoadingTarget = HTMLImageElement | string
2+
3+
export function loadImage<Target extends LoadingTarget>(
4+
img: Target,
5+
): Promise<HTMLImageElement>
6+
7+
export function loadImages<TargetList extends LoadingTarget[]>(
8+
imgs: TargetList,
9+
): Promise<HTMLImageElement[]>

0 commit comments

Comments
 (0)