@celljs/ta-changes 4.8.0 → 4.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +0,0 @@
1
- import type { ChangedFile, ChangeSet } from './changes-protocol';
2
-
3
- export namespace ChangesUtil {
4
- /** Text has no NUL byte in its first 8 KB, as git decides. */
5
- export function isText(data: Uint8Array | undefined): boolean {
6
- return !data?.subarray(0, 8000).includes(0);
7
- }
8
-
9
- export function totals(files: ChangedFile[]): { added: number; removed: number } {
10
- return files.reduce((sum, file) => ({ added: sum.added + file.added, removed: sum.removed + file.removed }), { added: 0, removed: 0 });
11
- }
12
-
13
- /** A path for people: relative to the session's directory when it is inside, else whole. */
14
- export function relative(path: string, root: string): string {
15
- const base = root.replace(/[\\/]+$/, '');
16
- if (base && path.length > base.length && path.startsWith(base) && /[\\/]/.test(path[base.length])) {
17
- return path.slice(base.length + 1);
18
- }
19
- return path;
20
- }
21
-
22
- /** The name of a file and the directory it is in, as the list of changes shows them; `dir` is empty at the root. */
23
- export function place(path: string, root: string): { name: string; dir: string } {
24
- const shown = relative(path, root);
25
- const index = Math.max(shown.lastIndexOf('/'), shown.lastIndexOf('\\'));
26
- return index < 0 ? { name: shown, dir: '' } : { name: shown.slice(index + 1), dir: shown.slice(0, index) || shown.slice(0, 1) };
27
- }
28
-
29
- /** The text of the message, for whoever reads the session without the web client (pi's terminal, an export). */
30
- export function summary(set: ChangeSet): string {
31
- const files = set.files.map(
32
- file => `${relative(file.path, set.root)} (${file.before === undefined && !file.large ? 'new, ' : ''}+${file.added} -${file.removed})`,
33
- );
34
- return `Changed ${set.files.length === 1 ? '1 file' : `${set.files.length} files`}: ${files.join(', ')}`;
35
- }
36
-
37
- /** What Ta reads after the user took the changes of a reply back. */
38
- export function revertNote(paths: string[], root: string): string {
39
- return (
40
- 'The user took back the changes you made to these files in one of your earlier replies; they are as they were before that reply: ' +
41
- `${paths.map(path => relative(path, root)).join(', ')}. Read them again before you change them.`
42
- );
43
- }
44
- }
@@ -1,60 +0,0 @@
1
- import type { ChangedFile, ChangeSet } from './changes-protocol';
2
- import { ChangesUtil } from './changes-util';
3
- import { icon, message, pi, t } from './page';
4
- import { React } from './react';
5
-
6
- /** Opens the diff of a file of a reply in the workbench, as a preview tab. */
7
- export function openDiff(set: ChangeSet, file: ChangedFile): void {
8
- const { name } = ChangesUtil.place(file.path, set.root);
9
- pi.ui.openEditor(
10
- {
11
- id: `ta-changes:${set.id}:${file.path}`,
12
- title: () => t('diffTitle', { name }),
13
- icon: icon('FileDiff'),
14
- render: () => <DiffTab set={set} file={file} />,
15
- },
16
- { preview: true },
17
- );
18
- }
19
-
20
- async function text(hash: string | undefined): Promise<string | null> {
21
- return hash ? pi.callHost<string | null>('read', hash) : '';
22
- }
23
-
24
- function DiffTab({ set, file }: { set: ChangeSet; file: ChangedFile }) {
25
- const [texts, setTexts] = React.useState<{ before: string; after: string } | { error: string }>();
26
- React.useEffect(() => {
27
- if (file.binary || file.large) {
28
- return;
29
- }
30
- let live = true;
31
- Promise.all([text(file.before), text(file.after)]).then(
32
- ([before, after]) => live && setTexts(before === null || after === null ? { error: t('gone') } : { before, after }),
33
- error => live && setTexts({ error: message(error) }),
34
- );
35
- return () => {
36
- live = false;
37
- };
38
- }, [file]);
39
- const empty = file.binary ? t('binary') : file.large ? t('large') : !texts ? t('loading') : 'error' in texts ? texts.error : undefined;
40
- return (
41
- <div className="tcg-diff">
42
- <div className="tcg-diff-head">
43
- <span className="tcg-diff-path" title={file.path}>
44
- {ChangesUtil.relative(file.path, set.root)}
45
- </span>
46
- <span className="tcg-stat">
47
- <span className="tcg-add">+{file.added}</span>
48
- <span className="tcg-del">−{file.removed}</span>
49
- </span>
50
- </div>
51
- <div className="tcg-diff-body">
52
- {empty !== undefined || !texts || 'error' in texts ? (
53
- <div className="tcg-diff-empty">{empty}</div>
54
- ) : (
55
- <pi.ui.DiffEditor path={file.path} original={texts.before} modified={texts.after} />
56
- )}
57
- </div>
58
- </div>
59
- );
60
- }
@@ -1,143 +0,0 @@
1
- import type { TaSessionFiles } from '@celljs/ta-protocol';
2
- import {
3
- CHANGES_TYPE,
4
- type ChangeSet,
5
- type ChangesService,
6
- NAME,
7
- REVERT_TYPE,
8
- type RevertDetails,
9
- type RevertResult,
10
- TA_FILE_WRITE_EVENT,
11
- TA_HOST_EVENT,
12
- } from './changes-protocol';
13
- import { ChangesUtil } from './changes-util';
14
- import { ChangeRecorder, revert } from './recorder';
15
-
16
- /** Under ta serve the host answers at once; `ta` alone has nobody to answer, and nothing shows the changes. */
17
- const HOST_WAIT_MS = 1000;
18
- /** The tools that write files, with the file in `path`. */
19
- const WRITING_TOOLS = new Set(['edit', 'write']);
20
-
21
- /** The little of pi's extension API this uses. */
22
- interface Entry {
23
- type: string;
24
- customType?: string;
25
- details?: unknown;
26
- }
27
- interface Context {
28
- isIdle(): boolean;
29
- sessionManager: { getSessionId(): string; getEntries(): Entry[]; getBranch(): Entry[] };
30
- }
31
- interface Message {
32
- role: string;
33
- customType?: string;
34
- }
35
- interface Pi {
36
- events: { emit(event: string, data: unknown): void; on(event: string, handler: (data: unknown) => void): unknown };
37
- on(event: string, handler: (event: never, ctx: never) => unknown): unknown;
38
- sendMessage(message: { customType: string; content: string; display: boolean; details: unknown }): void;
39
- }
40
- interface Reached {
41
- files: TaSessionFiles;
42
- service: ChangesService;
43
- }
44
-
45
- /**
46
- * The pi extension: before edit or write change a file the first time in a reply, or another coding
47
- * agent says its tools will (TA_FILE_WRITE_EVENT), it keeps what is there; when the reply ends, a message lists what changed (CHANGES_TYPE), which the web extension
48
- * shows above the message box. Ta does not read that message. It takes a reply's changes back when the page asks, through the host.
49
- */
50
- export default function activate(pi: Pi): void {
51
- let reached: Promise<Reached | undefined> | undefined;
52
- let recorder: ChangeRecorder | undefined;
53
- let detach: (() => void) | undefined;
54
- /** Set with the recorder: the event of another agent's writes is answered at once, without waiting for the host. */
55
- let reachedFiles: TaSessionFiles | undefined;
56
- const reach = () =>
57
- (reached ??= new Promise(resolve => {
58
- const timer = setTimeout(() => resolve(undefined), HOST_WAIT_MS);
59
- pi.events.emit(TA_HOST_EVENT, {
60
- name: NAME,
61
- resolve: (answer: { service?: unknown; files?: TaSessionFiles }) => {
62
- clearTimeout(timer);
63
- resolve(answer.service && answer.files ? { service: answer.service as ChangesService, files: answer.files } : undefined);
64
- },
65
- });
66
- }));
67
-
68
- pi.on('session_start', async (_event: unknown, ctx: Context) => {
69
- const found = await reach();
70
- if (!found) {
71
- return;
72
- }
73
- recorder = new ChangeRecorder(found.files, found.service);
74
- reachedFiles = found.files;
75
- detach?.();
76
- detach = found.service.attach(ctx.sessionManager.getSessionId(), {
77
- revert: (id, force) => takeBack(ctx, found, id, force),
78
- latest: () => changeSets(ctx.sessionManager.getBranch()).at(-1),
79
- });
80
- });
81
- pi.on('session_shutdown', () => {
82
- detach?.();
83
- detach = undefined;
84
- });
85
- pi.on('tool_call', async (event: { toolName: string; input?: { path?: unknown } }) => {
86
- const path = event.input?.path;
87
- if (recorder && WRITING_TOOLS.has(event.toolName) && typeof path === 'string' && path) {
88
- const found = await reach();
89
- if (found) {
90
- await recorder.before(found.files.resolve(path));
91
- }
92
- }
93
- });
94
- // Another coding agent writes with its own tools (ta-agents): it says so, before the write if it can.
95
- pi.events.on(TA_FILE_WRITE_EVENT, data => {
96
- const file = data as { path?: unknown; before?: unknown } | undefined;
97
- if (recorder && reachedFiles && typeof file?.path === 'string' && file.path) {
98
- const before = typeof file.before === 'string' || file.before === null ? file.before : undefined;
99
- void recorder.before(reachedFiles.resolve(file.path), before);
100
- }
101
- });
102
- pi.on('agent_settled', async () => {
103
- const found = recorder && (await reach());
104
- const set = found && (await recorder?.finish(found.files.resolve('.')));
105
- if (set) {
106
- pi.sendMessage({ customType: CHANGES_TYPE, content: ChangesUtil.summary(set), display: false, details: set });
107
- }
108
- });
109
- // The list is for the user: Ta knows what it changed from its own calls.
110
- pi.on('context', (event: { messages: Message[] }) => {
111
- const messages = event.messages.filter(message => !(message.role === 'custom' && message.customType === CHANGES_TYPE));
112
- return messages.length === event.messages.length ? undefined : { messages };
113
- });
114
-
115
- async function takeBack(ctx: Context, found: Reached, id: string, force: boolean): Promise<RevertResult> {
116
- if (!ctx.isIdle()) {
117
- return { reverted: [], conflicts: [], skipped: [], refused: 'busy' };
118
- }
119
- const set = find(ctx, id);
120
- if (!set) {
121
- return { reverted: [], conflicts: [], skipped: [], refused: 'missing' };
122
- }
123
- const result = await revert(set, found.files, found.service, force);
124
- if (result.reverted.length) {
125
- const details: RevertDetails = { id, files: result.reverted };
126
- pi.sendMessage({ customType: REVERT_TYPE, content: ChangesUtil.revertNote(result.reverted, set.root), display: true, details });
127
- }
128
- return result;
129
- }
130
- }
131
-
132
- function find(ctx: Context, id: string): ChangeSet | undefined {
133
- return changeSets(ctx.sessionManager.getEntries()).find(set => set.id === id);
134
- }
135
-
136
- function changeSets(entries: Entry[]): ChangeSet[] {
137
- return entries.flatMap(entry => {
138
- const details = entry.details as Partial<ChangeSet> | undefined;
139
- return entry.type === 'custom_message' && entry.customType === CHANGES_TYPE && typeof details?.id === 'string' && Array.isArray(details.files)
140
- ? [details as ChangeSet]
141
- : [];
142
- });
143
- }
package/web-src/host.ts DELETED
@@ -1,14 +0,0 @@
1
- import { join } from 'node:path';
2
- import type { TaExtensionHost, TaPackageService } from '@celljs/ta-protocol';
3
- import { BlobStore } from './blob-store';
4
- import { DefaultChangesService } from './changes-service';
5
-
6
- /**
7
- * The server side of the package (`pi.host`): it keeps the contents of the files replies changed, under
8
- * `<agentDir>/changes/`, and takes the changes of a reply back for the page through the session's pi extension.
9
- */
10
- export default function activate(host: TaExtensionHost): TaPackageService {
11
- const blobs = new BlobStore(join(host.agentDir, 'changes'));
12
- void blobs.prune().catch(() => undefined);
13
- return new DefaultChangesService(host, blobs);
14
- }
package/web-src/i18n.ts DELETED
@@ -1,59 +0,0 @@
1
- const EN = {
2
- filesChanged: '{count} files changed',
3
- fileChanged: '1 file changed',
4
- undo: 'Undo the changes of this reply',
5
- undoing: 'Taking back…',
6
- created: 'new',
7
- conflictTitle: 'Files changed again since',
8
- conflictMessage: '{files} changed after this reply. Undoing writes them back as they were before it, and the later changes are lost.',
9
- overwrite: 'Undo anyway',
10
- skipped: 'Not taken back, as their contents were not kept: {files}',
11
- nothing: 'These files are already as they were before this reply.',
12
- busy: 'Ta is still working in this conversation; undo once it stops.',
13
- closed: 'This conversation is not open in the Ta service; open it again and retry.',
14
- missing: 'This reply is not in the conversation any more.',
15
- failed: 'Could not undo: {message}',
16
- revertNote: 'Took back the changes to {count} files',
17
- revertNoteOne: 'Took back the changes to 1 file',
18
- diffTitle: '{name} (changes)',
19
- binary: 'A binary file: no diff to show.',
20
- large: 'The file is too large: its contents before and after were not kept.',
21
- gone: 'The kept contents were cleaned up: no diff to show.',
22
- loading: 'Loading…',
23
- };
24
-
25
- type Words = typeof EN;
26
-
27
- const ZH: Words = {
28
- filesChanged: '{count} 个文件已更改',
29
- fileChanged: '1 个文件已更改',
30
- undo: '撤销本轮改动',
31
- undoing: '正在撤销…',
32
- created: '新建',
33
- conflictTitle: '有文件在这之后又改过',
34
- conflictMessage: '{files} 在这一轮之后又被修改过。撤销会把它们恢复成这一轮之前的样子,之后的修改会丢失。',
35
- overwrite: '仍然撤销',
36
- skipped: '这些文件没有保存内容,未能撤销:{files}',
37
- nothing: '这些文件已经是这一轮之前的样子了。',
38
- busy: 'Ta 还在这个对话里工作,等它停下再撤销。',
39
- closed: 'Ta 服务里没有打开这个对话,重新打开后再试。',
40
- missing: '这一轮已经不在对话里了。',
41
- failed: '撤销失败:{message}',
42
- revertNote: '已撤销 {count} 个文件的改动',
43
- revertNoteOne: '已撤销 1 个文件的改动',
44
- diffTitle: '{name}(本轮改动)',
45
- binary: '二进制文件,不显示差异。',
46
- large: '文件太大,没有保存改动前后的内容。',
47
- gone: '保存的内容已被清理,无法显示差异。',
48
- loading: '加载中…',
49
- };
50
-
51
- export namespace ChangesWords {
52
- export function of(language: string): Words {
53
- return language === 'zh-CN' ? ZH : EN;
54
- }
55
-
56
- export function format(text: string, values: Record<string, string | number>): string {
57
- return text.replace(/\{(\w+)\}/g, (whole, key: string) => (key in values ? String(values[key]) : whole));
58
- }
59
- }
package/web-src/index.tsx DELETED
@@ -1,26 +0,0 @@
1
- import type { WebExtensionAPI } from '@celljs/ta-web/lib/browser/extension/web-extension-api';
2
- import { ChangesBar, RevertNote } from './card';
3
- import { REVERT_TYPE } from './changes-protocol';
4
- import { bindPage, Latest, Reverted } from './page';
5
- import { bind } from './react';
6
- import { injectStyle } from './style';
7
-
8
- /**
9
- * Above the message box, the files the last reply that changed any changed: how many, the lines added and removed, the diff of each in the
10
- * workbench, and a button that takes them back. The pi extension (extension.ts) records them and the
11
- * host (host.ts) keeps their contents; this only shows them.
12
- */
13
- export default function activate(pi: WebExtensionAPI): () => void {
14
- bind(pi.React);
15
- bindPage(pi);
16
- const removeStyle = injectStyle();
17
- const stopWatching = Reverted.watch();
18
- Latest.watch();
19
- pi.ui.setWidget('changes', ChangesBar);
20
- pi.registerMessageRenderer(REVERT_TYPE, RevertNote);
21
- return () => {
22
- stopWatching();
23
- pi.ui.setWidget('changes', undefined);
24
- removeStyle();
25
- };
26
- }
@@ -1,25 +0,0 @@
1
- import { describe, expect, it } from 'bun:test';
2
- import { LineDiff } from './line-diff';
3
-
4
- describe('LineDiff', () => {
5
- it('counts lines as git diff --stat does', () => {
6
- expect(LineDiff.count('a\nb\nc\n', 'a\nB\nc\n')).toEqual({ added: 1, removed: 1 });
7
- expect(LineDiff.count('', 'a\nb\n')).toEqual({ added: 2, removed: 0 });
8
- expect(LineDiff.count('a\nb\n', '')).toEqual({ added: 0, removed: 2 });
9
- expect(LineDiff.count('a\nb\nc\nd\n', 'a\nx\nb\nd\ny\n')).toEqual({ added: 2, removed: 1 });
10
- expect(LineDiff.count('same\n', 'same\n')).toEqual({ added: 0, removed: 0 });
11
- });
12
-
13
- it('finds the fewest edits when lines move', () => {
14
- expect(LineDiff.count('1\n2\n3\n4\n5\n', '2\n3\n4\n5\n1\n')).toEqual({ added: 1, removed: 1 });
15
- expect(LineDiff.count('a\nb\na\nb\n', 'b\na\nb\na\n')).toEqual({ added: 1, removed: 1 });
16
- });
17
-
18
- it('counts texts that differ in too many places as replaced, without the cost', () => {
19
- const before = Array.from({ length: 6000 }, (_, index) => `old ${index}`).join('\n');
20
- const after = Array.from({ length: 5000 }, (_, index) => `new ${index}`).join('\n');
21
- const started = performance.now();
22
- expect(LineDiff.count(before, after)).toEqual({ added: 5000, removed: 6000 });
23
- expect(performance.now() - started).toBeLessThan(2000);
24
- });
25
- });
@@ -1,65 +0,0 @@
1
- /** Lines added and removed between two texts, as `git diff --stat` counts them. */
2
- export namespace LineDiff {
3
- /** Beyond this many edits the texts count as replaced: the counts then say every line in between changed. */
4
- export const MAX_EDITS = 4000;
5
-
6
- export function lines(text: string): string[] {
7
- if (!text) {
8
- return [];
9
- }
10
- const lines = text.split('\n');
11
- if (lines[lines.length - 1] === '') {
12
- lines.pop();
13
- }
14
- return lines;
15
- }
16
-
17
- export function count(before: string, after: string): { added: number; removed: number } {
18
- const a = lines(before);
19
- const b = lines(after);
20
- // The lines both start and end with are no edits: only those in between go to Myers' algorithm.
21
- let start = 0;
22
- while (start < a.length && start < b.length && a[start] === b[start]) {
23
- start++;
24
- }
25
- let endA = a.length;
26
- let endB = b.length;
27
- while (endA > start && endB > start && a[endA - 1] === b[endB - 1]) {
28
- endA--;
29
- endB--;
30
- }
31
- const n = endA - start;
32
- const m = endB - start;
33
- if (!n || !m) {
34
- return { added: m, removed: n };
35
- }
36
- const edits = distance(a.slice(start, endA), b.slice(start, endB), Math.min(n + m, MAX_EDITS));
37
- if (edits === undefined) {
38
- return { added: m, removed: n };
39
- }
40
- // Each edit adds or removes a line, and the added minus the removed are m - n.
41
- return { added: (edits + m - n) / 2, removed: (edits - m + n) / 2 };
42
- }
43
-
44
- /** The fewest lines to add and remove to make `a` into `b` (Myers, 1986); undefined when more than `max`. */
45
- function distance(a: string[], b: string[], max: number): number | undefined {
46
- const offset = max + 1;
47
- const furthest = new Int32Array(2 * max + 3);
48
- for (let edits = 0; edits <= max; edits++) {
49
- for (let diagonal = -edits; diagonal <= edits; diagonal += 2) {
50
- const down = diagonal === -edits || (diagonal !== edits && furthest[offset + diagonal - 1] < furthest[offset + diagonal + 1]);
51
- let x = down ? furthest[offset + diagonal + 1] : furthest[offset + diagonal - 1] + 1;
52
- let y = x - diagonal;
53
- while (x < a.length && y < b.length && a[x] === b[y]) {
54
- x++;
55
- y++;
56
- }
57
- furthest[offset + diagonal] = x;
58
- if (x >= a.length && y >= b.length) {
59
- return edits;
60
- }
61
- }
62
- }
63
- return undefined;
64
- }
65
- }
package/web-src/page.ts DELETED
@@ -1,107 +0,0 @@
1
- import type { WebExtensionAPI, WebIcon } from '@celljs/ta-web/lib/browser/extension/web-extension-api';
2
- import { CHANGES_TYPE, type ChangeSet, REVERTED_KEY } from './changes-protocol';
3
- import { ChangesWords } from './i18n';
4
- import { React } from './react';
5
-
6
- /** The API ta gave the web extension when it started. */
7
- export let pi: WebExtensionAPI;
8
-
9
- export function bindPage(api: WebExtensionAPI): void {
10
- pi = api;
11
- }
12
-
13
- /** The words of the page's language, with `{name}` filled in. */
14
- export function t(key: keyof ReturnType<typeof ChangesWords.of>, values: Record<string, string | number> = {}): string {
15
- return ChangesWords.format(ChangesWords.of(pi.ui.language)[key], values);
16
- }
17
-
18
- /** An icon of the page by its lucide name; a blank one when the page does not have it. */
19
- export function icon(name: string): WebIcon {
20
- return pi.ui.icons[name] ?? (() => null);
21
- }
22
-
23
- export function message(error: unknown): string {
24
- return error instanceof Error ? error.message : String(error);
25
- }
26
-
27
- /** The change sets taken back, from the package's data on the server: the same in every browser. */
28
- export namespace Reverted {
29
- let ids = new Set<string>();
30
- let loading = false;
31
- const listeners = new Set<() => void>();
32
-
33
- function load(): Promise<void> {
34
- return pi.storage.get<string[]>(REVERTED_KEY).then(value => {
35
- ids = new Set(Array.isArray(value) ? value : []);
36
- for (const listener of listeners) {
37
- listener();
38
- }
39
- });
40
- }
41
-
42
- /** Starts listening; stops when the extension unloads. */
43
- export function watch(): () => void {
44
- return pi.storage.onChange(keys => {
45
- if (keys.includes(REVERTED_KEY)) {
46
- void load();
47
- }
48
- });
49
- }
50
-
51
- /** A React hook: whether the change set was taken back. */
52
- export function use(id: string): boolean {
53
- const [, setVersion] = React.useState(0);
54
- React.useEffect(() => {
55
- const listener = () => setVersion(version => version + 1);
56
- listeners.add(listener);
57
- if (!loading) {
58
- loading = true;
59
- load().catch(() => {
60
- loading = false;
61
- });
62
- }
63
- return () => {
64
- listeners.delete(listener);
65
- };
66
- }, []);
67
- return ids.has(id);
68
- }
69
-
70
- /** Taken back by this page: shown at once, before the server's data says so. */
71
- export function add(id: string): void {
72
- ids = new Set([...ids, id]);
73
- for (const listener of listeners) {
74
- listener();
75
- }
76
- }
77
- }
78
-
79
- /** The change sets Ta sends in the conversation shown, and when the conversation was replaced (a fork, a jump in its tree). */
80
- export namespace Latest {
81
- type Listener = (set: ChangeSet | 'replaced') => void;
82
- const listeners = new Set<Listener>();
83
-
84
- function tell(value: ChangeSet | 'replaced'): void {
85
- for (const listener of listeners) {
86
- listener(value);
87
- }
88
- }
89
-
90
- /** Starts listening; stops when the extension unloads (pi.on). */
91
- export function watch(): void {
92
- pi.on('message_end', event => {
93
- const message = event.message as { role?: string; customType?: string; details?: ChangeSet };
94
- if (message.role === 'custom' && message.customType === CHANGES_TYPE && message.details?.files) {
95
- tell(message.details);
96
- }
97
- });
98
- pi.on('session_replaced', () => tell('replaced'));
99
- }
100
-
101
- export function subscribe(listener: Listener): () => void {
102
- listeners.add(listener);
103
- return () => {
104
- listeners.delete(listener);
105
- };
106
- }
107
- }
package/web-src/react.ts DELETED
@@ -1,11 +0,0 @@
1
- import type * as ReactModule from 'react';
2
-
3
- /**
4
- * The React of the page, which a web extension cannot import: `activate` binds it before anything
5
- * renders. The JSX of this package compiles to `React.createElement` (tsconfig.json).
6
- */
7
- export let React: typeof ReactModule;
8
-
9
- export function bind(react: typeof ReactModule): void {
10
- React = react;
11
- }