Skip to content

Commit 57372cc

Browse files
authored
Merge pull request #176 from hwaphon/fix/ts-build-errors
fix(runtime-web & plugin-compiler-web): ts errors fixed
2 parents 40897bc + f917e0d commit 57372cc

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

packages/plugin-compiler-web/src/compiler/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function isEnableStyleScope(options: BuildOptions) {
2121
return options.appConfig.styleScope || options.styleScope
2222
}
2323

24-
export function isEnableSelectOwnerComponent(options: BuildOptions) {
24+
export function isEnableSelectOwnerComponent(options) {
2525
if (
2626
options.userConfig &&
2727
options.userConfig.web &&

packages/runtime-web/src/api/media/audio/Audio.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
import { defaults, EVENTS, removeValue } from './helper'
2-
3-
// Audio 参数 https://opendocs.alipay.com/mini/08iqsg?pathHash=d97ea89d#%E6%A6%82%E8%A7%88
4-
export interface AudioParams {
5-
src?: string
6-
startTime?: number
7-
playbackRate?: number
8-
autoplay?: boolean
9-
loop?: boolean
10-
volume?: number
11-
}
1+
import { AudioParams, defaults, EVENTS, removeValue } from './helper'
2+
3+
export { AudioParams } from './helper'
124

135
export class InnerAudio {
146
private params: AudioParams
@@ -83,7 +75,7 @@ export class InnerAudio {
8375
return this.audio.playbackRate
8476
}
8577

86-
private _executeCallbacks(callbacks, params) {
78+
private _executeCallbacks(callbacks, params?) {
8779
if (Array.isArray(callbacks) && callbacks.length > 0) {
8880
callbacks.forEach((callback) => callback(params))
8981
}

packages/runtime-web/src/api/media/audio/helper.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Audio 参数 https://opendocs.alipay.com/mini/08iqsg?pathHash=d97ea89d#%E6%A6%82%E8%A7%88
2+
export interface AudioParams {
3+
src?: string
4+
startTime?: number
5+
playbackRate?: number
6+
autoplay?: boolean
7+
loop?: boolean
8+
volume?: number
9+
}
10+
111
export const defaults = (params: AudioParams) => {
212
const defaultParams: AudioParams = {
313
startTime: 0,

0 commit comments

Comments
 (0)