{"id":"egomoose/tween-promise","name":"tween-promise","scope":"egomoose","platform":"roblox","description":"https://github.com/EgoMoose/tween-promise","version":"0.3.0","latest":"0.3.0","versions":["0.1.1","0.1.2","0.1.3","0.2.0","0.3.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"evaera/promise":{"version":"^4.0.0","alias":"Promise"}},"integrity":"f34b9a73489ccadeda72fd7cc1c507502e95789f2dec38cff246e3825b2dbe83","likes":0,"downloads":0,"install":"forest install egomoose/tween-promise","url":"https://forest.dev/p/roblox/egomoose/tween-promise","files":"https://api.forest.dev/ai/package/roblox/egomoose/tween-promise/files","readme":"# tween-promise\r\n \r\nA set of [promise](https://github.com/evaera/roblox-lua-promise) wrappers for the Roblox TweenService.\r\n\r\nGet it here:\r\n\r\n* [Wally](https://wally.run/package/egomoose/tween-promise)\r\n* [Releases](https://github.com/EgoMoose/tween-promise/releases)\r\n\r\n## API\r\n\r\n```Lua\r\ntype TweenInfoOptions = {\r\n\ttime: number?,\r\n\teasingStyle: Enum.EasingStyle?,\r\n\teasingDirection: Enum.EasingDirection?,\r\n\trepeatCount: number?,\r\n\treverses: boolean?,\r\n\tdelayTime: number?,\r\n}\r\n\r\n--[=[\r\nCreates a TweenInfo object\r\n\r\n@param options TweenInfoOptions -- Key value pairs of standard tween info arguments. If value is omitted then default is used.\r\n@return TweenInfo\r\n--]=]\r\nfunction module.info(options: TweenInfoOptions): TweenInfo\r\n```\r\n\r\n```Lua\r\n--[=[\r\nProvides a generalized linear interpolation function for all tween friendly data types.\r\nIt should match with how Roblox internally interpolates tween friendly data types.\r\n\r\n@param from T & TweenFriendly -- The starting value of the lerp\r\n@param to T & TweenFriendly -- The ending value of the lerp\r\n@param alpha number -- The percentage between from and to\r\n@return T\r\n--]=]\r\nfunction module.lerp<T>(from: T & TweenFriendly, to: T & TweenFriendly, alpha: number): T\r\n\r\n--[=[\r\nThis is the same as Promise.resolve which is a function often used in tandem with the module\r\n\r\n@param ... any -- The starting value of the lerp\r\n@return Promise\r\n--]=]\r\nfunction module.resolve(...: any): Promise\r\n```\r\n\r\n```Lua\r\n--[=[\r\nCreates a new tween promise with a numerical callback.\r\n\r\n@param from number -- The number the tween will start at\r\n@param to number -- The number the tween will transition to\r\n@param tweenInfo TweenInfo -- The tween info that the tween will use\r\n@param callback (number) - () -- A function that is called each tween step with the current tween value\r\n@return Promise\r\n--]=]\r\nfunction module.callback(from: number, to: number, tweenInfo: TweenInfo, callback: (number) - ()): Promise\r\n\r\n--[=[\r\nCreates a new tween promise for an instance.\r\n\r\n@param instance Instance -- The instance the tween will run on\r\n@param tweenInfo TweenInfo -- The tween info that the tween will use\r\n@param properties { [string]: TweenFriendly }) -- A key pair dictionary of where key = property_name and value = tween_target\r\n@return Promise\r\n--]=]\r\nfunction module.new(instance: Instance, tweenInfo: TweenInfo, properties: { [string]: TweenFriendly }): Promise\r\n```\r\n\r\n```Lua\r\ntype TweenCallbackOptions = {\r\n\tfrom: number, -- The number the tween will start at\r\n\tto: number, -- The number the tween will transition to\r\n\tinitial: number?, -- where the alpha should start should be between [from, to] (defaults to from if nil)\r\n\tyieldStep: (() -> ())?, -- how long the tween should wait between its next step (defaults to RunService.Stepped:Wait())\r\n}\r\n\r\n--[=[\r\nCreates a new tween promise with a numerical callback.\r\n\r\n@param options TweenCallbackOptions -- a list of options that will be used internally by the tween\r\n@param tweenInfo TweenInfo -- The tween info that the tween will use\r\n@param callback (number) - () -- A function that is called each tween step with the current tween value\r\n@return Promise\r\n--]=]\r\nfunction module.detailed.callback(options: TweenCallbackOptions, tweenInfo: TweenInfo, callback: (number) - ()): Promise\r\n\r\n--[=[\r\nCreates a new tween promise for an instance.\r\n\r\n@param options TweenCallbackOptions -- a list of options that will be used internally by the tween\r\n@param instance Instance -- The instance the tween will run on\r\n@param tweenInfo TweenInfo -- The tween info that the tween will use\r\n@param properties { [string]: TweenFriendly }) -- A key pair dictionary of where key = property_name and value = tween_target\r\n@return Promise\r\n--]=]\r\nfunction module.detailed.new(options: TweenCallbackOptions, instance: Instance, tweenInfo: TweenInfo, properties: { [string]: TweenFriendly }): Promise\r\n```","readmeBorrowedFrom":{"version":"0.2.0","source":"wally"},"readmeTruncated":false}