webrtc-mock
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -9,2 +9,1 @@ export declare const ENDED = "ended"; | ||
export declare const REMOVE_TRACK = "removetrack"; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -7,2 +7,1 @@ import MediaStreamMock from './MediaStreamMock'; | ||
export default createMediaStreamMock; | ||
//# sourceMappingURL=createMediaStreamMock.d.ts.map |
@@ -0,6 +1,6 @@ | ||
import type { TOptions } from './mediaStreamTrackMock'; | ||
import MediaStreamTrackMock from './mediaStreamTrackMock'; | ||
export declare const createAudioMediaStreamTrackMock: (options?: any) => MediaStreamTrackMock; | ||
export declare const createVideoMediaStreamTrackMock: (options?: any) => MediaStreamTrackMock; | ||
export declare const createAudioMediaStreamTrackMock: (options?: TOptions) => MediaStreamTrackMock; | ||
export declare const createVideoMediaStreamTrackMock: (options?: TOptions) => MediaStreamTrackMock; | ||
export declare const createAudioContextAudioMediaStreamTrackMock: () => MediaStreamTrackMock; | ||
export declare const createCanvasVideoMediaStreamTrackMock: () => MediaStreamTrackMock; | ||
//# sourceMappingURL=createMediaStreamTrackMock.d.ts.map |
@@ -55,2 +55,1 @@ export declare const VIDEO_KIND: "videoinput"; | ||
}[]; | ||
//# sourceMappingURL=devicesMock.d.ts.map |
declare const doMock: () => void; | ||
export default doMock; | ||
//# sourceMappingURL=doMock.d.ts.map |
@@ -6,2 +6,1 @@ export declare const ERROR_NOT_READABLE = "NotReadableError"; | ||
export declare const PERMISSION_DENIED = "Permission denied"; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -5,2 +5,1 @@ export declare const getNotReadableErrorVideo: () => Error; | ||
export declare const getPermissionDeniedBySystemError: () => Error; | ||
//# sourceMappingURL=errors.d.ts.map |
import MediaStreamMock from './MediaStreamMock'; | ||
declare const getAudioContextMediaStreamMock: () => Promise<MediaStreamMock>; | ||
export default getAudioContextMediaStreamMock; | ||
//# sourceMappingURL=getAudioContextMediaStreamMock.d.ts.map |
@@ -31,2 +31,1 @@ declare const getAvailableDevicesWithResolutions: ({ hasAccessDeviceAudioOutput }?: { | ||
export default getAvailableDevicesWithResolutions; | ||
//# sourceMappingURL=getAvailableDevicesWithResolutions.d.ts.map |
import MediaStreamMock from './MediaStreamMock'; | ||
declare const getCanvasMediaStreamMock: () => Promise<MediaStreamMock>; | ||
export default getCanvasMediaStreamMock; | ||
//# sourceMappingURL=getCanvasMediaStreamMock.d.ts.map |
@@ -1,17 +0,15 @@ | ||
import { createAudioMediaStreamTrackMock, createVideoMediaStreamTrackMock, createAudioContextAudioMediaStreamTrackMock, createCanvasVideoMediaStreamTrackMock } from './createMediaStreamTrackMock'; | ||
import { getAvailableDevices } from './devicesMock'; | ||
export { default as MediaStreamTrackMock } from './MediaStreamTrackMock'; | ||
export { default as MediaStreamMock } from './MediaStreamMock'; | ||
export { default as createMediaStreamMock } from './createMediaStreamMock'; | ||
export { default as doMock } from './doMock'; | ||
export { default as getAudioContextMediaStreamMock } from './getAudioContextMediaStreamMock'; | ||
export { default as getAvailableDevicesWithResolutions } from './getAvailableDevicesWithResolutions'; | ||
export { default as getCanvasMediaStreamMock } from './getCanvasMediaStreamMock'; | ||
export { default as createMediaStreamMock } from './createMediaStreamMock'; | ||
export { default as parseTracks } from './utils/parseTracks'; | ||
export { default as parseObject } from './utils/parseObject'; | ||
export { default as MediaStreamTrackMock } from './mediaStreamTrackMock'; | ||
export { default as resolutionsList } from './resolutionsList'; | ||
export { default as parseMediaStream } from './utils/parseMediaStream'; | ||
export { default as parseMediaStreamWithoutId } from './utils/parseMediaStreamWithoutId'; | ||
export { default as parseObject } from './utils/parseObject'; | ||
export { default as parseTracks } from './utils/parseTracks'; | ||
export { default as resolveParseArray } from './utils/resolveParseArray'; | ||
export { default as getAvailableDevicesWithResolutions } from './getAvailableDevicesWithResolutions'; | ||
export { default as resolutionsList } from './resolutionsList'; | ||
export { default as doMock } from './doMock'; | ||
export { createAudioMediaStreamTrackMock, createVideoMediaStreamTrackMock, createAudioContextAudioMediaStreamTrackMock, createCanvasVideoMediaStreamTrackMock, getAvailableDevices, }; | ||
//# sourceMappingURL=index.d.ts.map | ||
export { createAudioContextAudioMediaStreamTrackMock, createCanvasVideoMediaStreamTrackMock, createAudioMediaStreamTrackMock, createVideoMediaStreamTrackMock, } from './createMediaStreamTrackMock'; | ||
export { getAvailableDevices } from './devicesMock'; |
@@ -7,3 +7,3 @@ import type MediaStreamTrackMock from './mediaStreamTrackMock'; | ||
declare class MediaStreamMock implements MediaStream { | ||
private _events; | ||
private readonly events; | ||
private tracks; | ||
@@ -13,16 +13,15 @@ id: string; | ||
constructor(tracks?: MediaStreamTrackMock[]); | ||
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; | ||
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; | ||
onaddtrack: ((this: MediaStream, event_: MediaStreamTrackEvent) => unknown) | null; | ||
onremovetrack: ((this: MediaStream, event_: MediaStreamTrackEvent) => unknown) | null; | ||
getTracks: () => MediaStreamTrackMock[]; | ||
getAudioTracks: () => MediaStreamTrackMock[]; | ||
getVideoTracks: () => MediaStreamTrackMock[]; | ||
addTrack: (track: MediaStreamTrackMock) => MediaStreamMock; | ||
removeTrack(track: MediaStreamTrack): MediaStreamMock; | ||
addTrack: (track: MediaStreamTrackMock) => this; | ||
removeTrack(track: MediaStreamTrack): this; | ||
addEventListener: (eventName: TEventName, handler: THandler) => void; | ||
removeEventListener: (eventName: TEventName, handler: THandler) => void; | ||
dispatchEvent(event: Event): boolean; | ||
clone(): MediaStreamMock; | ||
clone(): this; | ||
getTrackById(trackId: string): MediaStreamTrack | null; | ||
} | ||
export default MediaStreamMock; | ||
//# sourceMappingURL=MediaStreamMock.d.ts.map |
@@ -5,4 +5,8 @@ declare const eventsNames: readonly ["ended", "mute", "unmute", "isolationchange", "overconstrained"]; | ||
type THandler = (event: Event) => void; | ||
export type TOptions = { | ||
id?: string; | ||
constraints?: MediaTrackConstraints; | ||
}; | ||
declare class MediaStreamTrackMock implements MediaStreamTrack { | ||
private _events; | ||
private readonly events; | ||
id: string; | ||
@@ -17,10 +21,7 @@ kind: string; | ||
muted: boolean; | ||
onended: ((this: MediaStreamTrack, ev: Event) => any) | null; | ||
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null; | ||
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null; | ||
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null; | ||
constructor(kind: string, { id, constraints }?: { | ||
id?: string | undefined; | ||
constraints?: {} | undefined; | ||
}); | ||
onended: ((this: MediaStreamTrack, event_: Event) => unknown) | null; | ||
onisolationchange: ((this: MediaStreamTrack, event_: Event) => unknown) | null; | ||
onmute: ((this: MediaStreamTrack, event_: Event) => unknown) | null; | ||
onunmute: ((this: MediaStreamTrack, event_: Event) => unknown) | null; | ||
constructor(kind: string, { id, constraints }?: TOptions); | ||
clone(): MediaStreamTrack; | ||
@@ -37,2 +38,1 @@ getCapabilities(): MediaTrackCapabilities; | ||
export default MediaStreamTrackMock; | ||
//# sourceMappingURL=mediaStreamTrackMock.d.ts.map |
@@ -16,2 +16,1 @@ export declare const ID_720P = "720p"; | ||
export default resolutionsList; | ||
//# sourceMappingURL=resolutionsList.d.ts.map |
import type MediaStreamMock from '../MediaStreamMock'; | ||
declare const parseMediaStream: (mediaStream: MediaStreamMock) => MediaStreamMock; | ||
export default parseMediaStream; | ||
//# sourceMappingURL=parseMediaStream.d.ts.map |
@@ -5,2 +5,1 @@ import type MediaStreamMock from '../MediaStreamMock'; | ||
export default parseMediaStreamWithoutId; | ||
//# sourceMappingURL=parseMediaStreamWithoutId.d.ts.map |
@@ -1,3 +0,2 @@ | ||
declare const parseObject: (obj: Record<string, unknown>) => any; | ||
declare const parseObject: <T = Record<string, unknown>>(object: T) => T; | ||
export default parseObject; | ||
//# sourceMappingURL=parseObject.d.ts.map |
import type mediaStreamTrackMock from '../mediaStreamTrackMock'; | ||
declare const parseTracks: (array: mediaStreamTrackMock[]) => mediaStreamTrackMock[]; | ||
export default parseTracks; | ||
//# sourceMappingURL=parseTracks.d.ts.map |
@@ -1,3 +0,2 @@ | ||
declare const resolveParseArray: <T>(prop: string) => (array: T[]) => T[]; | ||
declare const resolveParseArray: <T = Record<string, unknown>, K = keyof T>(property: K) => (array: T[]) => T[]; | ||
export default resolveParseArray; | ||
//# sourceMappingURL=resolveParseArray.d.ts.map |
{ | ||
"name": "webrtc-mock", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Classes and functions mock webrtc api for tests", | ||
@@ -24,20 +24,22 @@ "keywords": [ | ||
"type": "module", | ||
"main": "dist/index.umd.js", | ||
"module": "dist/index.es5.js", | ||
"typings": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.es.js" | ||
} | ||
}, | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
"dist" | ||
], | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "yarn build:ts && yarn build:js", | ||
"build:js": "NODE_ENV=production rollup --config", | ||
"build:ts": "tsc --build tsconfig.build.json && cp ./src/global.d.ts dist", | ||
"format": "prettier --write \"src/**/*.ts\"", | ||
"lint": "eslint src/. --ext .ts", | ||
"lint:ts": "tsc --noEmit", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm run lint", | ||
"release": "standard-version" | ||
"build": "vite build", | ||
"lint": "yarn lint:js && yarn lint:ts", | ||
"lint:danger": "danger ci --failOnErrors", | ||
"lint:js": "eslint src --ext ts,tsx --ignore-path .gitignore --report-unused-disable-directives --max-warnings 0", | ||
"lint:ts": "tsc", | ||
"prepare": "husky install", | ||
"prepublishOnly": "yarn build", | ||
"preview": "vite preview", | ||
"release": "standard-version && git push --follow-tags origin main" | ||
}, | ||
@@ -48,29 +50,33 @@ "dependencies": { | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.6.6", | ||
"@commitlint/config-conventional": "^17.6.6", | ||
"@rollup/plugin-commonjs": "^25.0.2", | ||
"@rollup/plugin-node-resolve": "^15.1.0", | ||
"@typescript-eslint/eslint-plugin": "^5.60.0", | ||
"@typescript-eslint/parser": "^5.60.0", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"@babel/preset-typescript": "^7.22.15", | ||
"@commitlint/cli": "^17.7.1", | ||
"@commitlint/config-conventional": "^17.7.0", | ||
"@nabla/vite-plugin-eslint": "1.5.0", | ||
"@typescript-eslint/eslint-plugin": "^6.7.0", | ||
"@typescript-eslint/parser": "^6.7.0", | ||
"@vitejs/plugin-basic-ssl": "1.0.1", | ||
"concurrently": "^8.2.1", | ||
"cross-env": "7.0.3", | ||
"danger": "^11.2.8", | ||
"eslint": "^8.49.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-airbnb-typescript": "17.1.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-import-resolver-typescript": "^3.6.0", | ||
"eslint-plugin-flowtype": "^8.0.3", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-plugin-unicorn": "48.0.1", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^13.2.2", | ||
"prettier": "^2.8.8", | ||
"promise-delay": "^2.1.0", | ||
"rollup": "^3.25.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-typescript2": "0.35.0", | ||
"lint-staged": "^14.0.1", | ||
"prettier": "^3.0.3", | ||
"sass": "^1.66.1", | ||
"standard-version": "^9.5.0", | ||
"typescript": "^5.1.3" | ||
"tsc-files": "^1.1.4", | ||
"typescript": "^5.2.2", | ||
"vite": "^4.4.9", | ||
"vite-plugin-dts": "3.5.3", | ||
"vite-tsconfig-paths": "^4.2.1" | ||
}, | ||
"main:src": "src/index.ts", | ||
"standard-version": { | ||
"scripts": { | ||
"prerelease": "npm run lint", | ||
"postchangelog": "prettier --write \"CHANGELOG.md\"" | ||
} | ||
} | ||
"peerDependencies": {} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
44325
29
25
800
1