Skip to content

Commit

Permalink
Improve typing for Device—add "name" property
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Nov 5, 2024
1 parent 48858c3 commit 5a07bf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-devices",
"homepage": "https://screenshotone.com",
"version": "1.0.2",
"version": "1.0.3",
"description": "A list of supported devices for ScreenshotOne.com API to emulate devices when generating screenshots.",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ export interface Viewport {
export interface Device {
userAgent: string;
viewport: Viewport;
name: string;
}

const knownDevices = [
const knownDevices: Device[] = [

Check failure on line 38 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

The type 'readonly [{ readonly name: "Blackberry PlayBook"; readonly userAgent: "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+"; readonly viewport: { ...; }; }, ... 133 more ..., { ...; }]' is 'readonly' and cannot be assigned to the mutable type 'Device[]'.

Check failure on line 38 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (17.x)

The type 'readonly [{ readonly name: "Blackberry PlayBook"; readonly userAgent: "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+"; readonly viewport: { ...; }; }, ... 133 more ..., { ...; }]' is 'readonly' and cannot be assigned to the mutable type 'Device[]'.

Check failure on line 38 in src/main.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

The type 'readonly [{ readonly name: "Blackberry PlayBook"; readonly userAgent: "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+"; readonly viewport: { ...; }; }, ... 133 more ..., { ...; }]' is 'readonly' and cannot be assigned to the mutable type 'Device[]'.
{
name: "Blackberry PlayBook",
userAgent:
Expand Down

0 comments on commit 5a07bf1

Please sign in to comment.