Skip to content

Commit

Permalink
TableColumn type
Browse files Browse the repository at this point in the history
  • Loading branch information
ChapC committed Apr 26, 2024
1 parent 815901e commit 206c0d7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/graph/workbooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export {
ITables,
ITableRow,
ITableRows,
ITableColumn,
ITableColumns
} from "./types.js";
27 changes: 25 additions & 2 deletions packages/graph/workbooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { _GraphCollection, graphInvokableFactory, _GraphInstance, GraphQueryable
import {
Workbook as WorkbookType,
WorkbookTable as WorkbookTableType,
WorkbookTableRow as WorkbookTableRowType
WorkbookTableRow as WorkbookTableRowType,
WorkbookTableColumn as WorkbookTableColumnType
} from "@microsoft/microsoft-graph-types";
import { graphPost } from "@pnp/graph";

Expand Down Expand Up @@ -34,6 +35,9 @@ export class _Table extends _GraphInstance<WorkbookTableType> {
public get rows(): ITableRows {
return TableRows(this);
}
public get columns(): ITableColumns {
return TableColumns(this);
}
}
export interface ITable extends _Table, IUpdateable, IDeleteable {}
export const Table = graphInvokableFactory<ITable>(_Table);
Expand Down Expand Up @@ -65,4 +69,23 @@ export class _TableRows extends _GraphCollection<WorkbookTableRowType[]> {
}
}
export interface ITableRows extends _TableRows, IAddable {}
export const TableRows = graphInvokableFactory<ITableRows>(_TableRows);
export const TableRows = graphInvokableFactory<ITableRows>(_TableRows);

@deleteable()
@updateable()
export class _TableColumn extends _GraphInstance<WorkbookTableColumnType> {

}
export interface ITableColumn extends _TableColumn, IUpdateable, IDeleteable {}
export const TableColumn = graphInvokableFactory<ITableColumn>(_TableColumn);

@defaultPath("columns")
@addable()
@getById(TableColumn)
export class _TableColumns extends _GraphCollection<WorkbookTableColumnType[]> {
public getByName(name: string): ITableColumn {
return TableColumn(this, name);
}
}
export interface ITableColumns extends _TableColumns, IAddable {}
export const TableColumns = graphInvokableFactory<ITableColumns>(_TableColumns);

0 comments on commit 206c0d7

Please sign in to comment.