Skip to content

Commit

Permalink
Clean up extra interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bcameron1231 committed Jan 9, 2024
1 parent 89edbb8 commit a7143db
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions packages/graph/onenote/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class _Notebook extends _GraphInstance<INotebookType> {
* Copy notebook
* @param props of type ICopyProps. groupId (id of group to copy to. Use only when copying to M365 group), renameAs name of the copy.
*/
public async copy(props: ICopyProps): Promise<IOperationType> {
public async copy(props: Pick<ICopyProps, "renameAs" | "groupId">): Promise<IOperationType> {
return graphPost(GraphQueryable(this, "copyNoteBook"), body(props));
}
}
Expand Down Expand Up @@ -113,17 +113,17 @@ export class _Section extends _GraphInstance<IOnenoteSectionType> {

/**
* Copy section to notebook
* @param props of type ICopySectionProps. groupId (id of group to copy to. Use only when copying to M365 group), id of destination notebook, renameAs name of the copy.
* @param props of type ICopyProps. groupId (id of group to copy to. Use only when copying to M365 group), id of destination notebook, renameAs name of the copy.
*/
public async copyToNotebook(props: ICopySectionProps): Promise<IOperationType> {
public async copyToNotebook(props: ICopyProps): Promise<IOperationType> {
return graphPost(GraphQueryable(this, "copyToNoteBook"), body(props));
}

/**
* Copy section group
* @param props of type ICopySectionProps. groupId (id of group to copy to. Use only when copying to M365 group), id of destination notebook, renameAs name of the copy.
* @param props of type ICopyProps. groupId (id of group to copy to. Use only when copying to M365 group), id of destination notebook, renameAs name of the copy.
*/
public async copyToSectionGroup(props: ICopySectionProps): Promise<IOperationType> {
public async copyToSectionGroup(props: ICopyProps): Promise<IOperationType> {
return graphPost(GraphQueryable(this, "copyToNoteBook"), body(props));
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ export class _Page extends _GraphInstance<IOnenotePageType> {
* Copy page to section
* @param props of type ICopyPageProps. groupId (id of group to copy to. Use only when copying to M365 group), id of destination notebook
*/
public async copyToSection(props: ICopyPageProps): Promise<IOperationType> {
public async copyToSection(props: Pick<ICopyProps, "id" | "groupId">): Promise<IOperationType> {
return graphPost(GraphQueryable(this, "copyToSection"), body(props));
}

Expand Down Expand Up @@ -258,17 +258,8 @@ export class _Resources extends _GraphInstance {
export interface IResources extends _Resources { }
export const Resources = graphInvokableFactory<IResources>(_Resources);


export interface ICopyProps {
groupId?: string;
renameAs?: string;
}

export interface ICopySectionProps extends ICopyProps {
id: string;
}

export interface ICopyPageProps {
groupId?: string;
id: string;
}

0 comments on commit a7143db

Please sign in to comment.