|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | 3 | // found in the LICENSE file. |
4 | 4 |
|
5 | | -/* eslint-disable no-unused-private-class-members */ |
| 5 | +import type * as Platform from '../../../core/platform/platform.js'; |
6 | 6 | import type * as Protocol from '../../../generated/protocol.js'; |
7 | 7 |
|
8 | 8 | import type {Micro, Milli, Seconds, TraceWindowMicro} from './Timing.js'; |
@@ -1937,55 +1937,37 @@ export function isDebuggerAsyncTaskRun(event: Event): event is DebuggerAsyncTask |
1937 | 1937 | return event.name === Name.DEBUGGER_ASYNC_TASK_RUN; |
1938 | 1938 | } |
1939 | 1939 |
|
1940 | | -class ProfileIdTag { |
1941 | | - readonly #profileIdTag: (symbol|undefined); |
1942 | | -} |
1943 | | -export type ProfileID = string&ProfileIdTag; |
| 1940 | +export type ProfileID = Platform.Brand.Brand<string, 'profileIdTag'>; |
1944 | 1941 |
|
1945 | 1942 | export function ProfileID(value: string): ProfileID { |
1946 | 1943 | return value as ProfileID; |
1947 | 1944 | } |
1948 | 1945 |
|
1949 | | -class CallFrameIdTag { |
1950 | | - readonly #callFrameIdTag: (symbol|undefined); |
1951 | | -} |
1952 | | -export type CallFrameID = number&CallFrameIdTag; |
| 1946 | +export type CallFrameID = Platform.Brand.Brand<number, 'callFrameIdTag'>; |
1953 | 1947 |
|
1954 | 1948 | export function CallFrameID(value: number): CallFrameID { |
1955 | 1949 | return value as CallFrameID; |
1956 | 1950 | } |
1957 | 1951 |
|
1958 | | -class SampleIndexTag { |
1959 | | - readonly #sampleIndexTag: (symbol|undefined); |
1960 | | -} |
1961 | | -export type SampleIndex = number&SampleIndexTag; |
| 1952 | +export type SampleIndex = Platform.Brand.Brand<number, 'sampleIndexTag'>; |
1962 | 1953 |
|
1963 | 1954 | export function SampleIndex(value: number): SampleIndex { |
1964 | 1955 | return value as SampleIndex; |
1965 | 1956 | } |
1966 | 1957 |
|
1967 | | -class ProcessIdTag { |
1968 | | - readonly #processIdTag: (symbol|undefined); |
1969 | | -} |
1970 | | -export type ProcessID = number&ProcessIdTag; |
| 1958 | +export type ProcessID = Platform.Brand.Brand<number, 'processIdTag'>; |
1971 | 1959 |
|
1972 | 1960 | export function ProcessID(value: number): ProcessID { |
1973 | 1961 | return value as ProcessID; |
1974 | 1962 | } |
1975 | 1963 |
|
1976 | | -class ThreadIdTag { |
1977 | | - readonly #threadIdTag: (symbol|undefined); |
1978 | | -} |
1979 | | -export type ThreadID = number&ThreadIdTag; |
| 1964 | +export type ThreadID = Platform.Brand.Brand<number, 'threadIdTag'>; |
1980 | 1965 |
|
1981 | 1966 | export function ThreadID(value: number): ThreadID { |
1982 | 1967 | return value as ThreadID; |
1983 | 1968 | } |
1984 | 1969 |
|
1985 | | -class WorkerIdTag { |
1986 | | - readonly #workerIdTag: (symbol|undefined); |
1987 | | -} |
1988 | | -export type WorkerId = string&WorkerIdTag; |
| 1970 | +export type WorkerId = Platform.Brand.Brand<string, 'workerIdTag'>; |
1989 | 1971 |
|
1990 | 1972 | export function WorkerId(value: string): WorkerId { |
1991 | 1973 | return value as WorkerId; |
@@ -2068,7 +2050,7 @@ export function isCommitLoad( |
2068 | 2050 | export function isAnimation( |
2069 | 2051 | event: Event, |
2070 | 2052 | ): event is Animation { |
2071 | | - // We've found some rare traces with an Animtation trace event from a different category: https://crbug.com/1472375#comment7 |
| 2053 | + // We've found some rare traces with an Animation trace event from a different category: https://crbug.com/1472375#comment7 |
2072 | 2054 | return event.name === 'Animation' && event.cat.includes('devtools.timeline'); |
2073 | 2055 | } |
2074 | 2056 |
|
|
0 commit comments