Appearance
Function: deleteFileEval()
ts
function deleteFileEval(
ctx: Context,
token: string,
options: {
driveId: string;
fileId: string;
}): Promise<boolean>;Defined in: src/ms-graph/sharepointGraphEval.ts:766
Delete a file from a SharePoint drive via the Graph API (browser eval variant).
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The SDK context. |
token | string | Access token from getSharePointTokenUserAuth. |
options | { driveId: string; fileId: string; } | The drive and file identifiers. |
options.driveId | string | The drive ID. |
options.fileId | string | The file ID. |
Returns
Promise<boolean>
True if the file was deleted.
Example
ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const deleted = await deleteFileEval(ctx, token, {
driveId: 'drive-abc123',
fileId: 'outdated-file-id',
});
console.log('Deleted:', deleted);