Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions types/react/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,4 @@ declare module '.' {
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
*/
export const SuspenseList: ExoticComponent<SuspenseListProps>;

/**
* this should be an internal type
*/
interface MutableSource<T> {
_source: T;
}

export type MutableSourceSubscribe<T> = (source: T, callback: () => void) => () => void;

// TODO: This may not be intentionally part of the experimental release considering useMutableSource is no longer available
/**
* @param source A source could be anything as long as they can be subscribed to and have a "version".
* @param getVersion A function returns a value which will change whenever part of the source changes.
*/
export function unstable_createMutableSource<T>(source: T, getVersion: () => any): MutableSource<T>;
}
23 changes: 0 additions & 23 deletions types/react/test/experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,3 @@ function suspenseTest() {
<React.Suspense fallback="Loading">A</React.Suspense>
<React.Suspense fallback="Loading">B</React.Suspense>
</React.SuspenseList>;

// We need these Window interfaces to compile
interface Window {
location: {
href: string;
pathname: string;
};
addEventListener(type: string, callback: () => void): void;
removeEventListener(type: string, callback: () => void): void;
}

const noop = () => {};

const window: Window = { location: { href: '', pathname: '' }, addEventListener: noop, removeEventListener: noop };

const locationSource = React.unstable_createMutableSource(window, () => window.location.href);

const getSnapshot = (window: Window) => window.location.pathname;

const subscribe: React.MutableSourceSubscribe<Window> = (window, callback) => {
window.addEventListener("popstate", callback);
return () => window.removeEventListener("popstate", callback);
};
2 changes: 1 addition & 1 deletion types/vite-plugin-react-svg/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Project: https://github.com/visualfanatic/vite-svg
// Definitions by: Priyanshu Rav <https://github.com/priyanshurav>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.8
// Minimum TypeScript Version: 4.0
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cherry-pick from #59777


import { Plugin } from 'vite';
import { OptimizeOptions } from 'svgo';
Expand Down
2 changes: 1 addition & 1 deletion types/vite-plugin-react-svg/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6", "dom"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cherry-pick from #59777

],
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down