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
35 changes: 35 additions & 0 deletions types/shelljs/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import shelljs = require("./index");

declare global {
const cat: typeof shelljs.cat;
const cd: typeof shelljs.cd;
const chmod: typeof shelljs.chmod;
const cmd: typeof shelljs.cmd;
const config: typeof shelljs.config;
const cp: typeof shelljs.cp;
const dirs: typeof shelljs.dirs;
const echo: typeof shelljs.echo;
const env: typeof shelljs.env;
const error: typeof shelljs.error;
const exec: typeof shelljs.exec;
const exit: typeof shelljs.exit;
const find: typeof shelljs.find;
const grep: typeof shelljs.grep;
const head: typeof shelljs.head;
const ln: typeof shelljs.ln;
const ls: typeof shelljs.ls;
const mkdir: typeof shelljs.mkdir;
const mv: typeof shelljs.mv;
const popd: typeof shelljs.popd;
const pushd: typeof shelljs.pushd;
const pwd: typeof shelljs.pwd;
const rm: typeof shelljs.rm;
const sed: typeof shelljs.sed;
const set: typeof shelljs.set;
const sort: typeof shelljs.sort;
const tail: typeof shelljs.tail;
const tempdir: typeof shelljs.tempdir;
const touch: typeof shelljs.touch;
const uniq: typeof shelljs.uniq;
const ShellString: typeof shelljs.ShellString;
}
4 changes: 2 additions & 2 deletions types/shelljs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="node"/>

import child = require("child_process");
import glob = require("glob");
import glob = require("fast-glob");

/**
* Changes the current working directory dir for the duration of the script.
Expand Down Expand Up @@ -1240,7 +1240,7 @@ export interface ShellConfig {
/**
* Passed to glob.sync() instead of the default options ({}).
*/
globOptions: glob.GlobOptions;
globOptions: glob.Options;

/**
* Absolute path of the Node binary. Default is null (inferred).
Expand Down
37 changes: 3 additions & 34 deletions types/shelljs/make.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import shelljs = require("./index");
import "./global";

declare global {
interface Target {
(...args: any[]): void;
Expand All @@ -7,38 +8,6 @@ declare global {
}
const target: {
all?: Target;
[s: string]: Target;
[s: string]: Target | undefined;
};

const cat: typeof shelljs.cat;
const cd: typeof shelljs.cd;
const chmod: typeof shelljs.chmod;
const cmd: typeof shelljs.cmd;
const config: typeof shelljs.config;
const cp: typeof shelljs.cp;
const dirs: typeof shelljs.dirs;
const echo: typeof shelljs.echo;
const env: typeof shelljs.env;
const error: typeof shelljs.error;
const exec: typeof shelljs.exec;
const exit: typeof shelljs.exit;
const find: typeof shelljs.find;
const grep: typeof shelljs.grep;
const head: typeof shelljs.head;
const ln: typeof shelljs.ln;
const ls: typeof shelljs.ls;
const mkdir: typeof shelljs.mkdir;
const mv: typeof shelljs.mv;
const popd: typeof shelljs.popd;
const pushd: typeof shelljs.pushd;
const pwd: typeof shelljs.pwd;
const rm: typeof shelljs.rm;
const sed: typeof shelljs.sed;
const set: typeof shelljs.set;
const sort: typeof shelljs.sort;
const tail: typeof shelljs.tail;
const tempdir: typeof shelljs.tempdir;
const touch: typeof shelljs.touch;
const uniq: typeof shelljs.uniq;
const ShellString: typeof shelljs.ShellString;
}
15 changes: 13 additions & 2 deletions types/shelljs/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
{
"private": true,
"name": "@types/shelljs",
"version": "0.8.9999",
"version": "0.10.9999",
"projects": [
"http://shelljs.org",
"https://github.com/shelljs/shelljs"
],
"exports": {
".": "./index.d.ts",
"./global": "./global.d.ts",
"./global.js": "./global.d.ts",
"./make": "./make.d.ts",
"./make.js": "./make.d.ts",
"./package": "./package.json",
"./package.json": "./package.json",
"./plugin": "./plugin.d.ts",
"./plugin.js": "./plugin.d.ts"
},
"dependencies": {
"glob": "^11.0.3",
"fast-glob": "^3.3.2",
"@types/node": "*"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions types/shelljs/plugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// TODO: proper typing
// https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins#pluginregister-options
export function register(...args: unknown[]): void;
12 changes: 10 additions & 2 deletions types/shelljs/shelljs-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ shell.chmod("u+x", "/Users/brandon");
shell.chmod("-cR", 755, "/Users/brandon");
shell.chmod("-Rv", "u+x", "/Users/brandon");

shell.exit(0);

shell.touch("/Users/brandom/test1");
shell.touch("/Users/brandom/test1", "/Users/brandom/test2");

Expand Down Expand Up @@ -206,3 +204,13 @@ const farr = new shell.ShellString(["hello", "world"]);

const boo = shell.ShellString("hello world");
const barr = shell.ShellString(["hello", "world"]);

require("shelljs/make");

// global works
cp("some/path", "/tmp/dst/");
target.all = () => {
ln("-sf", "some/path", "/tmp/dst");
};

shell.exit(0);
3 changes: 3 additions & 0 deletions types/shelljs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
"files": [
"index.d.ts",
"global.d.ts",
"make.d.ts",
"plugin.d.ts",
"shelljs-tests.ts"
]
}
5 changes: 5 additions & 0 deletions types/w3c-screen-capture/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
108 changes: 108 additions & 0 deletions types/w3c-screen-capture/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
* @see https://w3c.github.io/mediacapture-screen-share
*/

declare global {
interface MediaDevices {
getDisplayMedia(options?: DisplayMediaStreamOptions): Promise<MediaStream>;
}
}

export interface UserMediaStreamConstraints {
/** @default false */
video?: boolean | MediaTrackConstraints;
/** @default false */
audio?: boolean | MediaTrackConstraints;
}

export type CaptureStartFocusBehavior =
| "focus-capturing-application"
| "focus-captured-surface"
| "no-focus-change";

declare global {
class CaptureController extends EventTarget {
constructor();
setFocusBehavior(focusBehavior: CaptureStartFocusBehavior): void;
}
}

export type SelfCapturePreferenceEnum =
| "include"
| "exclude";

export type SystemAudioPreferenceEnum =
| "include"
| "exclude";

export type WindowAudioPreferenceEnum =
| "system"
| "window"
| "exclude";

export type SurfaceSwitchingPreferenceEnum =
| "include"
| "exclude";

export type MonitorTypeSurfacesEnum =
| "include"
| "exclude";

export interface DisplayMediaStreamOptions {
/** @default true */
video?: boolean | MediaTrackConstraints;
/** @default false */
audio?: boolean | MediaTrackConstraints;
controller?: CaptureController;
selfBrowserSurface?: SelfCapturePreferenceEnum;
systemAudio?: SystemAudioPreferenceEnum;
windowAudio?: WindowAudioPreferenceEnum;
surfaceSwitching?: SurfaceSwitchingPreferenceEnum;
monitorTypeSurfaces?: MonitorTypeSurfacesEnum;
}

export interface MediaTrackSupportedConstraints {
/** @default true */
displaySurface?: boolean;
/** @default true */
logicalSurface?: boolean;
/** @default true */
cursor?: boolean;
/** @default true */
restrictOwnAudio?: boolean;
/** @default true */
suppressLocalAudioPlayback?: boolean;
}

export interface MediaTrackConstraintSet {
displaySurface?: ConstrainDOMString;
logicalSurface?: ConstrainBoolean;
cursor?: ConstrainDOMString;
restrictOwnAudio?: ConstrainBoolean;
suppressLocalAudioPlayback?: ConstrainBoolean;
}

export interface MediaTrackSettings {
displaySurface?: string;
logicalSurface?: boolean;
cursor?: string;
restrictOwnAudio?: boolean;
suppressLocalAudioPlayback?: boolean;
screenPixelRatio?: number;
}

export interface MediaTrackCapabilities {
displaySurface?: string;
logicalSurface?: boolean;
cursor?: string[];
}

export type DisplayCaptureSurfaceType =
| "monitor"
| "window"
| "browser";

export type CursorCaptureConstraint =
| "never"
| "always"
| "motion";
28 changes: 28 additions & 0 deletions types/w3c-screen-capture/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-screen-capture",
"version": "0.0.9999",
"projects": [
"https://github.com/WICG/isolated-web-apps"
],
"devDependencies": {
"@types/web": "*",
"@types/w3c-screen-capture": "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-screen-capture/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-screen-capture": [
"./index.d.ts"
]
}
},
"files": [
"index.d.ts",
"w3c-screen-capture-tests.ts"
]
}
Loading