Skip to content

Commit

Permalink
Merge pull request #53 from gjsify/mark-gnome-types-for-47
Browse files Browse the repository at this point in the history
Mark gnome types for 47
  • Loading branch information
swsnr authored Sep 26, 2024
2 parents 4e6e386 + a1a5431 commit 381db6a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 42 deletions.
28 changes: 27 additions & 1 deletion packages/gnome-shell/src/misc/animationUtils.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js

import type St from '@girs/st-15';
import type Clutter from '@girs/clutter-15';

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js#L23
* @version 47
*/
export interface AdjustAnimationTimeParams {
/** whether to ignore the enable-animations setting */
animationRequired: boolean;
}

/**
* adjustAnimationTime:
*
* @param msecs - time in milliseconds
* @param params - optional parameters
*
* Adjust `msecs` to account for St's enable-animations
* and slow-down-factor settings
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js#L22
* @version 47
*/
export function adjustAnimationTime(msecs: number): number;

export function adjustAnimationTime(msecs: number, params?: AdjustAnimationTimeParams): number;

/**
* Animate scrolling a scrollview until an actor is visible.
*
* @param scrollView - the scroll view the actor is in
* @param actor - the actor
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js#L40
* @version 47
*/

export function ensureActorVisibleInScrollView(scrollView: St.ScrollView, actor: Clutter.Actor): void;

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js#L90
* @version 47
*/
export interface WiggleParams {
/** The offset to move the actor by per-wiggle */
offset: number;
Expand All @@ -35,6 +58,9 @@ export interface WiggleParams {
*
* @param actor an actor to animate
* @param params options for the animation
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/misc/animationUtils.js#L86
* @version 47
*/

export function wiggle(actor: Clutter.Actor, params: WiggleParams): void;
2 changes: 1 addition & 1 deletion packages/gnome-shell/src/types/extension-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type Gio from '@girs/gio-2.0';
/** The Metadata Object for Extensions
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/extensions/sharedInternals.js#L48
* @version 46
* @version 47
*/
export interface ExtensionMetadata {
readonly uuid: string;
Expand Down
16 changes: 8 additions & 8 deletions packages/gnome-shell/src/ui/dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type St from '@girs/st-15';

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L113
* @version 46
* @version 47
*/
export interface ButtonInfo {
action: () => void;
Expand All @@ -17,7 +17,7 @@ export interface ButtonInfo {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L18
* @version 46
* @version 47
*/
export class Dialog extends St.Widget {
protected _parentActor: St.Widget;
Expand All @@ -41,7 +41,7 @@ export class Dialog extends St.Widget {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L158
* @version 46
* @version 47
*/
export namespace MessageDialogContent {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
Expand All @@ -51,7 +51,7 @@ export namespace MessageDialogContent {
}
/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L171
* @version 46
* @version 47
*/
export class MessageDialogContent extends St.BoxLayout {
public title: string;
Expand All @@ -66,7 +66,7 @@ export class MessageDialogContent extends St.BoxLayout {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L250
* @version 46
* @version 47
*/
export namespace ListSection {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
Expand All @@ -76,7 +76,7 @@ export namespace ListSection {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L258
* @version 46
* @version 47
*/
export class ListSection extends St.BoxLayout {
protected _listScrollView: St.ScrollView;
Expand All @@ -91,7 +91,7 @@ export class ListSection extends St.BoxLayout {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L294
* @version 46
* @version 47
*/
export namespace ListSectionItem {
export interface ConstructorProps extends St.BoxLayout.ConstructorProps {
Expand All @@ -103,7 +103,7 @@ export namespace ListSectionItem {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dialog.js#L311
* @version 46
* @version 47
*/
export class ListSectionItem extends St.BoxLayout {
protected _iconActorBin: St.Bin;
Expand Down
26 changes: 13 additions & 13 deletions packages/gnome-shell/src/ui/layout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { BackgroundManager } from './background.js';

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L159
* @version 46
* @version 47
*/
export interface Geometry {
x: number;
Expand All @@ -27,7 +27,7 @@ export interface Geometry {
}
/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L41
* @version 46
* @version 47
*/

export namespace MonitorConstraint {
Expand All @@ -40,7 +40,7 @@ export namespace MonitorConstraint {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L56
* @version 46
* @version 47
*/
export class MonitorConstraint extends Clutter.Constraint {
protected _primary: boolean;
Expand All @@ -63,7 +63,7 @@ export class MonitorConstraint extends Clutter.Constraint {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L158
* @version 46
* @version 47
*/
declare class Monitor {
public index: number;
Expand All @@ -79,7 +79,7 @@ declare class Monitor {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L174
* @version 46
* @version 47
*/
declare class UiActor extends St.Widget {
public constructor(props?: Partial<St.Widget.ConstructorProps>);
Expand All @@ -91,7 +91,7 @@ declare class UiActor extends St.Widget {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L1454
* @version 46
* @version 47
*/
declare class ScreenTransition extends Clutter.Actor {
constructor();
Expand All @@ -109,7 +109,7 @@ declare class ScreenTransition extends Clutter.Actor {
* overview.
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L1141
* @version 46
* @version 47
*/
declare class HotCorner extends Clutter.Actor {
protected _entered: boolean;
Expand Down Expand Up @@ -137,7 +137,7 @@ declare class HotCorner extends Clutter.Actor {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L186
* @version 46
* @version 47
*/
export interface TrackedActors {
trackFullscreen: boolean;
Expand All @@ -147,7 +147,7 @@ export interface TrackedActors {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L192
* @version 46
* @version 47
*/
export class LayoutManager extends GObject.Object {
protected _rtl: boolean;
Expand Down Expand Up @@ -306,9 +306,9 @@ export class LayoutManager extends GObject.Object {
* of the screen.
*/
protected _prepareStartupAnimation(): Promise<void>;
protected _startupAnimation(): void;
protected _startupAnimationGreeter(): void;
protected _startupAnimationSession(): void;
protected _startupAnimation(): Promise<void>;
protected _startupAnimationGreeter(): Promise<void>;
protected _startupAnimationSession(): Promise<void>;
protected _startupAnimationComplete(): void;
protected _findActor(actor: Clutter.Actor): number;
protected _trackActor(actor: Clutter.Actor, params?: Partial<TrackedActors>): void;
Expand All @@ -323,7 +323,7 @@ export class LayoutManager extends GObject.Object {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/layout.js#L1309
* @version 46
* @version 47
*/
declare class PressureBarrier extends EventEmitter {
protected _threshold: number;
Expand Down
12 changes: 6 additions & 6 deletions packages/gnome-shell/src/ui/lightbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import type Shell from '@girs/shell-15';

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L10
* @version 46
* @version 47
*/
export const DEFAULT_FADE_FACTOR = 0.4;
export const VIGNETTE_BRIGHTNESS = 0.5;
export const VIGNETTE_SHARPNESS = 0.7;

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L31
* @version 46
* @version 47
*/
export namespace RadialShaderEffect {
export interface ConstructorProps extends Shell.GLSLEffect.ConstructorProps {
Expand All @@ -25,7 +25,7 @@ export namespace RadialShaderEffect {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L42
* @version 46
* @version 47
*/
export class RadialShaderEffect extends Shell.GLSLEffect {
protected _brightness: number;
Expand All @@ -42,7 +42,7 @@ export class RadialShaderEffect extends Shell.GLSLEffect {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L121
* @version 46
* @version 47
*/
export interface LightboxAdditionalParameters {
inhibitEvents?: boolean;
Expand All @@ -52,7 +52,7 @@ export interface LightboxAdditionalParameters {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L91
* @version 46
* @version 47
*/
export namespace Lightbox {
export interface ConstructorProps extends St.Bin.ConstructorProps, LightboxAdditionalParameters {
Expand All @@ -63,7 +63,7 @@ export namespace Lightbox {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/lightbox.js#L96
* @version 46
* @version 47
*/
export class Lightbox extends St.Bin {
protected _active: boolean;
Expand Down
8 changes: 6 additions & 2 deletions packages/gnome-shell/src/ui/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Panel } from './panel.js';
// import * as Params from '../misc/params.js'
// import * as RunDialog from './runDialog.js';
// import * as WelcomeDialog from './welcomeDialog.js';
import { LayoutManager } from './layout.js';
import { LayoutManager, UiActor } from './layout.js';
// import * as LoginManager from '../misc/loginManager.js'
// import * as LookingGlass from './lookingGlass.js';
import { NotificationDaemon } from './notificationDaemon.js';
Expand Down Expand Up @@ -100,7 +100,11 @@ export declare const actionMode: Shell.ActionMode.NONE;

export declare const modalActorFocusStack: any[];

export declare const uiGroup: any;
/**
* @deprecated use layoutManager.uiGroup instead
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/main.js#L212
*/
export declare const uiGroup: UiActor;

export declare const magnifier: any;

Expand Down
2 changes: 1 addition & 1 deletion packages/gnome-shell/src/ui/messageTray.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class Source extends MessageList.Source {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageTray.js#L604
* @version 46
* @version 47
*/
export declare namespace Notification {
export interface ObjectProperties {
Expand Down
8 changes: 4 additions & 4 deletions packages/gnome-shell/src/ui/panelMenu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import type { PopupMenu, PopupDummyMenu } from './popupMenu.js';

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/panelMenu.js#L11
* @version 46
* @version 47
*/
declare namespace ButtonBox {
interface ConstructorProps extends St.Widget.ConstructorProps {}
}

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/panelMenu.js#L12
* @version 46
* @version 47
*/
declare class ButtonBox extends St.Widget {
constructor(params?: Partial<ButtonBox.ConstructorProps>);
Expand All @@ -31,15 +31,15 @@ declare class ButtonBox extends St.Widget {

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/panelMenu.js#L95
* @version 46
* @version 47
*/
export namespace Button {
interface ConstructorProps extends ButtonBox.ConstructorProps {}
}

/**
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/panelMenu.js#L97
* @version 46
* @version 47
*/
export class Button extends ButtonBox {
menu: PopupMenu | PopupDummyMenu;
Expand Down
Loading

0 comments on commit 381db6a

Please sign in to comment.