mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-30 01:43:36 +08:00
At this point we use the pattern enough to warrant an explicit utility type to prevent minor code duplication. R=kprokopenko@chromium.org Bug: None Change-Id: Idb83c32b8e5ca616d9335a24aef2dd8b44a5a052 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4171285 Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
31 lines
923 B
TypeScript
31 lines
923 B
TypeScript
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import {type Brand} from './brand.js';
|
|
|
|
/**
|
|
* File paths in DevTools that are represented as URLs
|
|
* @example
|
|
* “file:///Hello%20World/file/js”
|
|
*/
|
|
export type UrlString = Brand<string, 'UrlString'>;
|
|
export const EmptyUrlString = '' as UrlString;
|
|
|
|
/**
|
|
* File paths in DevTools that are represented as unencoded absolute
|
|
* or relative paths
|
|
* @example
|
|
* “/Hello World/file.js”
|
|
*/
|
|
export type RawPathString = Brand<string, 'RawPathString'>;
|
|
export const EmptyRawPathString = '' as RawPathString;
|
|
|
|
/**
|
|
* File paths in DevTools that are represented as encoded paths
|
|
* @example
|
|
* “/Hello%20World/file.js”
|
|
*/
|
|
export type EncodedPathString = Brand<string, 'EncodedPathString'>;
|
|
export const EmptyEncodedPathString = '' as EncodedPathString;
|