Skip to content

Commit

Permalink
Merge pull request #34 from gjsify/beta-fixes
Browse files Browse the repository at this point in the history
Beta fixes: Optional Properties handling
  • Loading branch information
Totto16 authored Apr 19, 2024
2 parents cc91fa6 + 1dd1a3e commit 1422445
Show file tree
Hide file tree
Showing 22 changed files with 115 additions and 117 deletions.
6 changes: 3 additions & 3 deletions packages/gnome-shell/src/ui/animation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Animation extends St.Bin {
constructor(file: Gio.File, width: number, height: number, speed: number);

/** @hidden */
public _init(props?: St.Bin.ConstructorProps): void;
public _init(props?: Partial<St.Bin.ConstructorProps>): void;
public _init(file: Gio.File, width: number, height: number, speed: number): void;

public play(): void;
Expand All @@ -25,7 +25,7 @@ export class Animation extends St.Bin {
export class AnimatedIcon extends Animation {
constructor(file: Gio.File, size: number);
/** @hidden */
public _init(props?: St.Bin.ConstructorProps): void;
public _init(props?: Partial<St.Bin.ConstructorProps>): void;
/** @hidden */
public _init(file: Gio.File, width: number, height: number, speed: number): void;
public _init(file: Gio.File, size: number): void;
Expand All @@ -34,7 +34,7 @@ export class AnimatedIcon extends Animation {
export class Spinner extends AnimatedIcon {
constructor(size: number, params: { animate: boolean; hideOnStop: boolean });
/** @hidden */
public _init(props?: St.Bin.ConstructorProps): void;
public _init(props?: Partial<St.Bin.ConstructorProps>): void;
/** @hidden */
public _init(file: Gio.File, width: number, height: number, speed: number): void;
/** @hidden */
Expand Down
20 changes: 10 additions & 10 deletions packages/gnome-shell/src/ui/appDisplay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export class AppGrid extends IconGrid {
public indicatorsPadding: number;

/** @hidden */
public _init(params?: St.Viewport.ConstructorProps): void;
public _init(layoutParams?: IconGrid.ConstructorProps): void;
public _init(params?: Partial<St.Viewport.ConstructorProps>): void;
public _init(layoutParams?: Partial<IconGrid.ConstructorProps>): void;

protected _updatePadding(): void;
}

export abstract class BaseAppView extends St.Widget {
// TODO: 'view-loaded' signal
constructor(params?: St.Widget.ConstructorProps);
public _init(params?: St.Widget.ConstructorProps): void;
constructor(params?: Partial<St.Widget.ConstructorProps>);
public _init(params?: Partial<St.Widget.ConstructorProps>): void;

protected _onDestroy(): void;
protected _createGrid(): AppGrid;
Expand Down Expand Up @@ -111,8 +111,8 @@ export class AppViewItem extends St.Button {
readonly id: string;
readonly app: any;

constructor(params?: St.Button.ConstructorProps);
public _init(params?: St.Button.ConstructorProps, isDraggable?: boolean, expandTitleOnHover?: boolean): void;
constructor(params?: Partial<St.Button.ConstructorProps>);
public _init(params?: Partial<St.Button.ConstructorProps>, isDraggable?: boolean, expandTitleOnHover?: boolean): void;

protected _onDestroy(): void;
protected _updateMultiline(): void;
Expand All @@ -136,8 +136,8 @@ export class AppViewItem extends St.Button {

export namespace AppIcon {
export interface ConstructorProps extends BaseIcon.ConstructorProps {
isDraggable?: boolean;
expandTitleOnHover?: boolean;
isDraggable: boolean;
expandTitleOnHover: boolean;
}
}

Expand All @@ -153,8 +153,8 @@ export class AppIcon extends AppViewItem {
constructor(app: any, iconParams?: AppIcon.ConstructorProps);

/** @hidden */
public _init(params?: St.Button.ConstructorProps, isDraggable?: boolean, expandTitleOnHover?: boolean): void;
public _init(app: any, iconParams?: AppIcon.ConstructorProps): void;
public _init(params?: Partial<St.Button.ConstructorProps>, isDraggable?: boolean, expandTitleOnHover?: boolean): void;
public _init(app: any, iconParams?: Partial<AppIcon.ConstructorProps>): void;

protected _onDestroy(): void;
protected _createIcon(iconSize: number): St.Widget;
Expand Down
4 changes: 2 additions & 2 deletions packages/gnome-shell/src/ui/audioDeviceSelection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ declare class AudioDeviceSelectionDialog extends ModalDialog {
constructor(devices: number);

/** @hidden */
public _init(params?: St.Widget.ConstructorProps): void;
public _init(params?: Partial<St.Widget.ConstructorProps>): void;
/** @hidden */
public _init(props?: ModalDialog.ConstructorProps): void;
public _init(props?: Partial<ModalDialog.ConstructorProps>): void;
public _init(devices: number): void;

protected _buildLayout(): void;
Expand Down
6 changes: 3 additions & 3 deletions packages/gnome-shell/src/ui/background.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ declare class Background extends Meta.Background {
constructor(params?: { monitorIndex?: number; layoutManager: LayoutManager; settings?: Gio.Settings | null; file: Gio.File | null; style: string | null });

/** @hidden */
public _init(params?: Meta.Background.ConstructorProps): void;
public _init(params?: Partial<Meta.Background.ConstructorProps>): void;
public _init(params?: { monitorIndex?: number; layoutManager: LayoutManager; settings?: Gio.Settings | null; file: Gio.File | null; style: string | null }): void;

public destroy(): void;
Expand All @@ -165,7 +165,7 @@ export class SystemBackground extends Meta.BackgroundActor {
constructor();

/** @hidden */
public _init(params?: Meta.BackgroundActor.ConstructorProps): void;
public _init(params?: Partial<Meta.BackgroundActor.ConstructorProps>): void;
public _init(): void;
}

Expand Down Expand Up @@ -195,7 +195,7 @@ declare class BackgroundSource {
* wrapper for GnomeBG.BGSlideShow
*/
declare class Animation extends GnomeBG.BGSlideShow {
public _init(params?: GnomeBG.BGSlideShow.ConstructorProps): void;
public _init(params?: Partial<GnomeBG.BGSlideShow.ConstructorProps>): void;

/** @hidden */
load_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
Expand Down
5 changes: 2 additions & 3 deletions packages/gnome-shell/src/ui/barLevel.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/barLevel.js

import type St from '@girs/st-14';
import type Atk from '@girs/atk-1.0';

export namespace BarLevel {
export interface ConstructorProps extends St.DrawingArea.ConstructorProps {}
Expand All @@ -17,8 +16,8 @@ export class BarLevel extends St.DrawingArea {
public maximumValue: number;
public overdriveStart: number;

constructor(params?: BarLevel.ConstructorProps);
public _init(params?: BarLevel.ConstructorProps): void;
constructor(params?: Partial<BarLevel.ConstructorProps>);
public _init(params?: Partial<BarLevel.ConstructorProps>): void;

public vfunc_repaint(): void;

Expand Down
6 changes: 3 additions & 3 deletions packages/gnome-shell/src/ui/boxpointer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ export class BoxPointer extends St.Widget {
* @param arrowSide side to draw the arrow on
* @param binProperties Properties to set on contained bin
*/
constructor(arrowSide: St.Side, binProperties?: St.Bin.ConstructorProps);
constructor(arrowSide: St.Side, binProperties?: Partial<St.Bin.ConstructorProps>);

/** @hidden */
public _init(params?: St.Widget.ConstructorProps): void;
public _init(params?: Partial<St.Widget.ConstructorProps>): void;

/**
* @param arrowSide side to draw the arrow on
* @param binProperties Properties to set on contained bin
*/
public _init(arrowSide: St.Side, binProperties?: St.Bin.ConstructorProps): void;
public _init(arrowSide: St.Side, binProperties?: Partial<St.Bin.ConstructorProps>): void;

public vfunc_captured_event(event: Clutter.Event): boolean;

Expand Down
14 changes: 7 additions & 7 deletions packages/gnome-shell/src/ui/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class Calendar extends St.Widget {

constructor();
/** @hidden */
public _init(params?: St.Widget.ConstructorProps): void;
public _init(params?: Partial<St.Widget.ConstructorProps>): void;
public _init(): void;

public setEventSource(eventSource: EventSourceBase): void;
Expand All @@ -164,7 +164,7 @@ export class Calendar extends St.Widget {

export class NotificationMessage extends Message {
/** @hidden */
override _init(params?: St.Button.ConstructorProps): void;
override _init(params?: Partial<St.Button.ConstructorProps>): void;
/** @hidden */
override _init(title: string, body: string): void;
public _init(notification: Notification): void;
Expand All @@ -180,7 +180,7 @@ declare class TimeLabel extends St.Label {
_datetime: Date;

/** @hidden */
public _init(params?: St.Label.ConstructorProps): void;
public _init(params?: Partial<St.Label.ConstructorProps>): void;
public _init(datetime: Date): void;

public vfunc_map(): void;
Expand All @@ -190,7 +190,7 @@ declare class NotificationSection extends MessageListSection {
public readonly allowed: boolean;

/** @hidden */
public _init(params?: St.BoxLayout.ConstructorProps): void;
public _init(params?: Partial<St.BoxLayout.ConstructorProps>): void;
public _init(): void;

public vfunc_map(): void;
Expand All @@ -205,7 +205,7 @@ declare class Placeholder extends St.BoxLayout {
protected _label: St.Label;

/** @hidden */
override _init(params?: St.BoxLayout.ConstructorProps): void;
override _init(params?: Partial<St.BoxLayout.ConstructorProps>): void;
public _init(): void;
}

Expand All @@ -214,7 +214,7 @@ declare class DoNotDisturbSwitch extends Switch {

constructor();
/** @hidden */
override _init(config?: St.Bin.ConstructorProps): void;
override _init(config?: Partial<St.Bin.ConstructorProps>): void;
/** @hidden */
override _init(state: boolean): void;
public _init(): void;
Expand All @@ -233,7 +233,7 @@ export class CalendarMessageList extends St.Widget {
// visible: boolean;

/** @hidden */
override _init(config?: St.Widget.ConstructorProps): void;
override _init(config?: Partial<St.Widget.ConstructorProps>): void;
public _init(): void;

protected _addSection(section: MessageListSection): void;
Expand Down
2 changes: 1 addition & 1 deletion packages/gnome-shell/src/ui/checkBox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class CheckBox extends St.Button {

constructor(label?: string);
/** @hidden */
public _init(params?: St.Button.ConstructorProps): void;
public _init(params?: Partial<St.Button.ConstructorProps>): void;
public _init(label?: string): void;

public setLabel(label: string): void;
Expand Down
22 changes: 11 additions & 11 deletions packages/gnome-shell/src/ui/dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class Dialog extends St.Widget {
*/
export namespace MessageDialogContent {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
title?: string;
description?: string;
title: string;
description: string;
}
}
/**
Expand All @@ -57,8 +57,8 @@ export class MessageDialogContent extends St.BoxLayout {
public title: string;
public description: string;

constructor(params: MessageDialogContent.ConstructorProps);
public _init(params: MessageDialogContent.ConstructorProps): void;
constructor(params: Partial<MessageDialogContent.ConstructorProps>);
public _init(params: Partial<MessageDialogContent.ConstructorProps>): void;

protected _onDestroy(): void;
protected _updateTitleStyle(): void | false;
Expand All @@ -70,7 +70,7 @@ export class MessageDialogContent extends St.BoxLayout {
*/
export namespace ListSection {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
title?: string;
title: string;
}
}

Expand All @@ -85,8 +85,8 @@ export class ListSection extends St.BoxLayout {
public list: St.BoxLayout;
public title: string;

constructor(params: ListSection.ConstructorProps);
public _init(params: ListSection.ConstructorProps): void;
constructor(params: Partial<ListSection.ConstructorProps>);
public _init(params: Partial<ListSection.ConstructorProps>): void;
}

/**
Expand All @@ -95,9 +95,9 @@ export class ListSection extends St.BoxLayout {
*/
export namespace ListSectionItem {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
title?: string;
description?: string;
iconActor?: Clutter.Actor;
title: string;
description: string;
iconActor: Clutter.Actor;
}
}

Expand All @@ -116,6 +116,6 @@ export class ListSectionItem extends St.BoxLayout {
constructor(params: { style_class?: string | null });

/** @hidden Defined to resolve version conflicts */
public _init(config?: ListSectionItem.ConstructorProps): void;
public _init(config?: Partial<ListSectionItem.ConstructorProps>): void;
public _init(params: { style_class?: string | null }): void;
}
12 changes: 6 additions & 6 deletions packages/gnome-shell/src/ui/dnd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ export function removeDragMonitor(monitor: _Draggable): void;

declare namespace _Draggable {
export interface ConstructorProps {
manualMode?: boolean;
timeoutThreshold?: number;
restoreOnSuccess?: boolean;
dragActorMaxSize?: number;
dragActorOpacity?: number;
manualMode: boolean;
timeoutThreshold: number;
restoreOnSuccess: boolean;
dragActorMaxSize: number;
dragActorOpacity: number;
}
}

declare class _Draggable extends EventEmitter {
public actor: Clutter.Actor;

constructor(actor: Clutter.Actor, params: _Draggable.ConstructorProps);
constructor(actor: Clutter.Actor, params: Partial<_Draggable.ConstructorProps>);

/**
* fakeRelease:
Expand Down
16 changes: 8 additions & 8 deletions packages/gnome-shell/src/ui/iconGrid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import type Shell from '@girs/shell-14';

export namespace BaseIcon {
export interface ConstructorProps {
createIcon?: any | null;
setSizeManually?: boolean;
showLabel?: boolean;
createIcon: any | null;
setSizeManually: boolean;
showLabel: boolean;
}
}

Expand All @@ -19,10 +19,10 @@ export class BaseIcon extends Shell.SquareBin {

protected _setSizeManually?: boolean;

constructor(label: string, params?: BaseIcon.ConstructorProps);
constructor(label: string, params?: Partial<BaseIcon.ConstructorProps>);

public _init(params?: Shell.SquareBin.ConstructorProps): void;
public _init(label: string, params?: BaseIcon.ConstructorProps): void;
public _init(params?: Partial<Shell.SquareBin.ConstructorProps>): void;
public _init(label: string, params?: Partial<BaseIcon.ConstructorProps>): void;
}

export namespace IconGrid {
Expand All @@ -47,10 +47,10 @@ export class IconGrid extends St.Viewport {

protected _currentPage: number;

constructor(layoutParams?: IconGrid.ConstructorProps);
constructor(layoutParams?: Partial<IconGrid.ConstructorProps>);

/** @hidden */
public _init(params?: St.Viewport.ConstructorProps): void;
public _init(params?: Partial<St.Viewport.ConstructorProps>): void;
public _init(layoutParams?: IconGrid.ConstructorProps): void;

protected _childAdded(grid: IconGrid, child: St.Widget): void;
Expand Down
Loading

0 comments on commit 1422445

Please sign in to comment.