deps(speedline): use speedline's types instead of our own (#5078)

This commit is contained in:
Brendan Kenny 2018-04-30 22:37:54 -07:00 коммит произвёл Paul Irish
Родитель 25f920e09d
Коммит b38cdd3c57
4 изменённых файлов: 10 добавлений и 50 удалений

Просмотреть файл

@ -123,7 +123,7 @@
"rimraf": "^2.6.1",
"robots-parser": "^2.0.1",
"semver": "^5.3.0",
"speedline": "1.3.0",
"speedline": "1.3.2",
"update-notifier": "^2.1.0",
"ws": "3.3.2",
"yargs": "3.32.0",

2
typings/artifacts.d.ts поставляемый
Просмотреть файл

@ -320,7 +320,7 @@ declare global {
pessimisticGraph: Gatherer.Simulation.GraphNode;
}
export type Speedline = ReturnType<typeof speedline>;
export type Speedline = speedline.Output<'speedIndex'>;
// TODO(bckenny): all but navigationStart could actually be undefined.
export interface TraceTimes {

41
typings/speedline/index.d.ts поставляемый
Просмотреть файл

@ -1,41 +0,0 @@
/**
* @license Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
declare module 'speedline' {
interface SpeedlineOutput {
beginning: number;
end: number;
frames: Array<{
getHistogram(): number[][];
getTimeStamp(): number;
getImage(): Buffer;
setProgress(progress: number, isInterpolated: boolean): void;
setPerceptualProgress(progress: number, isInterpolated: boolean): void;
getProgress(): number;
getPerceptualProgress(): number;
isProgressInterpolated(): boolean;
isPerceptualProgressInterpolated(): boolean;
}>;
first: number;
complete: number;
duration: number;
// TODO: speedIndex may actually be optional based on input options.
// Use a more clever way to declare these exist based on SpeedlineOptions['include']
speedIndex: number;
perceptualSpeedIndex?: number;
}
interface SpeedlineOptions {
timeOrigin?: number;
fastMode?: boolean;
include?: 'all' | 'speedIndex' | 'perceptualSpeedIndex';
}
function speedline(trace: LH.TraceEvent[], opts: SpeedlineOptions): SpeedlineOutput;
export = speedline;
}

Просмотреть файл

@ -442,9 +442,9 @@ axios@^0.16.2:
follow-redirects "^1.2.3"
is-buffer "^1.1.5"
babar@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babar/-/babar-0.0.3.tgz#2f394d4a5918f7e1ae9e5408e9a96f3f935ee1e2"
babar@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/babar/-/babar-0.2.0.tgz#79bc0f029721467207f2b6baedf96b3938ad7db0"
dependencies:
colors "~0.6.2"
@ -4649,11 +4649,12 @@ spdx-license-ids@^1.0.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57"
speedline@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/speedline/-/speedline-1.3.0.tgz#201c458ca7aba2ac847fe5860c1a92966aaed3a9"
speedline@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/speedline/-/speedline-1.3.2.tgz#b48bf899568d917bbb14c8397453b14c4c0d0ed0"
dependencies:
babar "0.0.3"
"@types/node" "*"
babar "0.2.0"
image-ssim "^0.2.0"
jpeg-js "^0.1.2"
loud-rejection "^1.6.0"