PathUri.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. // GENERATED CODE! DO NOT MODIFY BY HAND!
  2. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
  3. /**
  4. * An immutable, cross-platform representation of a `file:` URI.
  5. *
  6. * Only the `file:` scheme is currently accepted. Construction validates the
  7. * URL, and the URI cannot be mutated after construction. [`Self::basename`],
  8. * [`Self::parent`], and [`Self::join`] operate on URI path segments without
  9. * interpreting them using the operating system running Codex. Fallback URIs
  10. * created by [`Self::from_abs_path`] are opaque to these lexical operations.
  11. *
  12. * `file:` paths retain their URI spelling so they can be parsed independently
  13. * of the current host, except that Windows drive letters are canonicalized to
  14. * uppercase. A local POSIX `file:` URI can also retain percent-encoded non-UTF-8
  15. * bytes for lossless native round trips.
  16. *
  17. * Like [VS Code resources], path operations use `/` URI separators on every
  18. * host. Lexical path operations preserve a URL authority without interpreting
  19. * Windows drive or UNC roots from path text. Windows path equality and hashing
  20. * ignore ASCII case, while POSIX paths remain case-sensitive. Native path
  21. * normalization, filesystem aliases, symlinks, and Unicode normalization are
  22. * not resolved.
  23. *
  24. * Serde represents a `PathUri` as its canonical URI string. Deserialization
  25. * accepts only valid `file:` URI strings. These strings round-trip through
  26. * their canonical URL form, including encoded non-UTF-8 path bytes.
  27. *
  28. * [VS Code resources]: https://github.com/microsoft/vscode/blob/main/src/vs/base/common/resources.ts
  29. */
  30. export type PathUri = string;