Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions types/dayjs-recur/dayjs-recur-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ d.dayOfMonth();
d.daysOfMonth();
d.weekOfMonth();
d.weeksOfMonth();
d.weeksOfMonthByDay();
d.weekOfYear();
d.weeksOfYear();
d.monthOfYear();
Expand Down
3 changes: 3 additions & 0 deletions types/dayjs-recur/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Recurrence {
daysOfMonth(unit?: string): Recurrence;
weekOfMonth(unit?: string): Recurrence;
weeksOfMonth(unit?: string): Recurrence;
weeksOfMonthByDay(unit?: string): Recurrence;
weekOfYear(unit?: string): Recurrence;
weeksOfYear(unit?: string): Recurrence;
monthOfYear(unit?: string): Recurrence;
Expand Down Expand Up @@ -52,5 +53,7 @@ declare module "dayjs" {
start?: string | Dayjs;
end?: string | Dayjs;
}): Recurrence;
monthWeekByDay(): number;
monthWeek(): number;
}
}
25 changes: 0 additions & 25 deletions types/dockerode/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,28 +661,14 @@ declare namespace Dockerode {
Healthcheck?: HealthConfig | undefined;
};
NetworkSettings: {
Bridge: string;
SandboxID: string;
HairpinMode: boolean;
LinkLocalIPv6Address: string;
LinkLocalIPv6PrefixLen: number;
Ports: {
[portAndProtocol: string]: Array<{
HostIp: string;
HostPort: string;
}>;
};
SandboxKey: string;
SecondaryIPAddresses?: any;
SecondaryIPv6Addresses?: any;
EndpointID: string;
Gateway: string;
GlobalIPv6Address: string;
GlobalIPv6PrefixLen: number;
IPAddress: string;
IPPrefixLen: number;
IPv6Gateway: string;
MacAddress: string;
Networks: {
[type: string]: {
IPAMConfig?: any;
Expand All @@ -699,17 +685,6 @@ declare namespace Dockerode {
MacAddress: string;
};
};
Node?:
| {
ID: string;
IP: string;
Addr: string;
Name: string;
Cpus: number;
Memory: number;
Labels: any;
}
| undefined;
};
}

Expand Down
2 changes: 1 addition & 1 deletion types/dockerode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/dockerode",
"version": "3.3.9999",
"version": "4.0.9999",
"projects": [
"https://github.com/apocas/dockerode"
],
Expand Down
5 changes: 5 additions & 0 deletions types/w3c-capture-all-screens/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
22 changes: 22 additions & 0 deletions types/w3c-capture-all-screens/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @see https://screen-share.github.io/capture-all-screens
*/

interface MediaDevices {
getAllScreensMedia(): Promise<MediaStream[]>;
}

interface ScreenCaptureMediaStreamTrack extends MediaStreamTrack {
screenDetailed(): ScreenDetailed;
}

interface ScreenDetailed extends Screen {
readonly availLeft: number;
readonly availTop: number;
readonly left: number;
readonly top: number;
readonly isPrimary: boolean;
readonly isInternal: boolean;
readonly devicePixelRatio: number;
readonly label: string;
}
28 changes: 28 additions & 0 deletions types/w3c-capture-all-screens/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"private": true,
"nonNpm": true,
"nonNpmDescription": "Implementation of Isolated Web App (IWA) APIs resides in Chromium.",
"name": "@types/w3c-capture-all-screens",
"version": "0.0.9999",
"projects": [
"https://github.com/WICG/isolated-web-apps"
],
"devDependencies": {
"@types/web": "*",
"@types/w3c-capture-all-screens": "workspace:."
},
"owners": [
{
"name": "Paulina Gacek",
"githubUsername": "paulinagacek"
},
{
"name": "Andrew Rayskiy",
"githubUsername": "GrapeGreen"
},
{
"name": "Simon Hangl",
"githubUsername": "shangl"
}
]
}
25 changes: 25 additions & 0 deletions types/w3c-capture-all-screens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "node16",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"w3c-capture-all-screens": [
"./index.d.ts"
]
}
},
"files": [
"index.d.ts",
"w3c-capture-all-screens-tests.ts"
]
}
55 changes: 55 additions & 0 deletions types/w3c-capture-all-screens/w3c-capture-all-screens-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
async function testGetAllScreensMedia() {
if (!navigator.mediaDevices || !navigator.mediaDevices.getAllScreensMedia) {
return;
}

// $ExpectType MediaStream[]
const streams = await navigator.mediaDevices.getAllScreensMedia();

// @ts-expect-error - arguments are not accepted
await navigator.mediaDevices.getAllScreensMedia({ video: true });
}

function testScreenCaptureTrack(track: MediaStreamTrack) {
// Check if the track has the method (type narrowing)
if ("screenDetailed" in track) {
// Cast to the interface that has the method
const screenTrack = track as ScreenCaptureMediaStreamTrack;

// $ExpectType ScreenDetailed
const details = screenTrack.screenDetailed();

testScreenDetailed(details);
}
}

function testScreenDetailed(details: ScreenDetailed) {
// $ExpectType number
details.availLeft;
// $ExpectType number
details.availTop;
// $ExpectType number
details.left;
// $ExpectType number
details.top;
// $ExpectType boolean
details.isPrimary;
// $ExpectType boolean
details.isInternal;
// $ExpectType number
details.devicePixelRatio;
// $ExpectType string
details.label;

// Inheritance Check: It should also be a valid Screen object
// $ExpectType number
details.width;
// $ExpectType number
details.height;

// @ts-expect-error - readonly property cannot be assigned
details.isPrimary = false;

// @ts-expect-error - property does not exist
details.nonExistentProperty;
}