Skip to content

Commit 1e44905

Browse files
committed
Update docs and API. Add missing types
1 parent 159f7d1 commit 1e44905

8 files changed

+12
-25
lines changed

docs/data/data-grid/server-side-data/ServerSideLazyLoadingInfinite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { DataGridPro, GridToolbar } from '@mui/x-data-grid-pro';
33
import { useMockServer } from '@mui/x-data-grid-generator';
44

5-
function ServerSideLazyLoading() {
5+
function ServerSideLazyLoadingInfinite() {
66
const { columns, fetchRows } = useMockServer(
77
{ rowLength: 120 },
88
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
@@ -42,4 +42,4 @@ function ServerSideLazyLoading() {
4242
);
4343
}
4444

45-
export default ServerSideLazyLoading;
45+
export default ServerSideLazyLoadingInfinite;

docs/data/data-grid/server-side-data/ServerSideLazyLoadingInfinite.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@mui/x-data-grid-pro';
88
import { useMockServer } from '@mui/x-data-grid-generator';
99

10-
function ServerSideLazyLoading() {
10+
function ServerSideLazyLoadingInfinite() {
1111
const { columns, fetchRows } = useMockServer(
1212
{ rowLength: 120 },
1313
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
@@ -47,4 +47,4 @@ function ServerSideLazyLoading() {
4747
);
4848
}
4949

50-
export default ServerSideLazyLoading;
50+
export default ServerSideLazyLoadingInfinite;

docs/data/data-grid/server-side-data/ServerSideLazyLoadingViewport.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { DataGridPro, GridToolbar } from '@mui/x-data-grid-pro';
33
import { useMockServer } from '@mui/x-data-grid-generator';
44

5-
function ServerSideLazyLoading() {
5+
function ServerSideLazyLoadingViewport() {
66
const { columns, fetchRows } = useMockServer(
77
{ rowLength: 120 },
88
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
@@ -43,4 +43,4 @@ function ServerSideLazyLoading() {
4343
);
4444
}
4545

46-
export default ServerSideLazyLoading;
46+
export default ServerSideLazyLoadingViewport;

docs/data/data-grid/server-side-data/ServerSideLazyLoadingViewport.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@mui/x-data-grid-pro';
88
import { useMockServer } from '@mui/x-data-grid-generator';
99

10-
function ServerSideLazyLoading() {
10+
function ServerSideLazyLoadingViewport() {
1111
const { columns, fetchRows } = useMockServer(
1212
{ rowLength: 120 },
1313
{ useCursorPagination: false, minDelay: 300, maxDelay: 800 },
@@ -48,4 +48,4 @@ function ServerSideLazyLoading() {
4848
);
4949
}
5050

51-
export default ServerSideLazyLoading;
51+
export default ServerSideLazyLoadingViewport;

docs/data/data-grid/server-side-data/infinite-loading.md

-15
This file was deleted.

packages/x-data-grid-pro/src/hooks/features/dataSource/cache.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class GridDataSourceCacheDefault {
4646
}
4747

4848
// split the range into chunks
49-
const chunkRanges = [];
49+
const chunkRanges: { startIndex: number; endIndex: number }[] = [];
5050
for (let i = params.start; i < params.end; i += this.chunkSize) {
5151
const endIndex = Math.min(i + this.chunkSize - 1, params.end);
5252
chunkRanges.push({ startIndex: i, endIndex });
@@ -102,7 +102,7 @@ export class GridDataSourceCacheDefault {
102102
return undefined;
103103
}
104104

105-
const cachedResponses = [];
105+
const cachedResponses: (GridGetRowsResponse | null)[] = [];
106106

107107
for (let i = startChunk; i <= endChunk; i += 1) {
108108
const keyString = getKey({ ...key, start: chunks[i].startIndex, end: chunks[i].endIndex });

scripts/x-data-grid-premium.exports.json

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
{ "name": "GridDataSourceApiBase", "kind": "Interface" },
252252
{ "name": "GridDataSourceCache", "kind": "Interface" },
253253
{ "name": "GridDataSourceCacheDefault", "kind": "Class" },
254+
{ "name": "GridDataSourceCacheDefaultConfig", "kind": "TypeAlias" },
254255
{ "name": "GridDataSourceGroupNode", "kind": "Interface" },
255256
{ "name": "GridDataSourcePrivateApi", "kind": "Interface" },
256257
{ "name": "GridDataSourceState", "kind": "Interface" },

scripts/x-data-grid-pro.exports.json

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
{ "name": "GridDataSourceApiBase", "kind": "Interface" },
225225
{ "name": "GridDataSourceCache", "kind": "Interface" },
226226
{ "name": "GridDataSourceCacheDefault", "kind": "Class" },
227+
{ "name": "GridDataSourceCacheDefaultConfig", "kind": "TypeAlias" },
227228
{ "name": "GridDataSourceGroupNode", "kind": "Interface" },
228229
{ "name": "GridDataSourcePrivateApi", "kind": "Interface" },
229230
{ "name": "GridDataSourceState", "kind": "Interface" },

0 commit comments

Comments
 (0)