Skip to content

Commit

Permalink
Fix tsc build (#2166)
Browse files Browse the repository at this point in the history
## Description

There was a problem with compiling typescript during the building release package. I tested it and now works properly.
  • Loading branch information
piaskowyk committed Jul 2, 2021
1 parent 54e5e13 commit 1d00b99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 5 additions & 2 deletions src/reanimated2/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
declare const _WORKLET: boolean;
declare const _stopObservingProgress: (tag: number, flag: boolean) => void;
declare const _startObservingProgress: (tag: number, flag: boolean) => void;
declare const _startObservingProgress: (
tag: number,
flag: { value: boolean; _value: boolean }
) => void;
declare namespace NodeJS {
interface Global {
LayoutAnimationRepository: {
Expand All @@ -9,7 +12,7 @@ declare namespace NodeJS {
removeConfig(tag: number): void;
startAnimationForTag(
tag: number,
type: unknown,
type: string,
yogaValues: unknown
): void;
};
Expand Down
8 changes: 4 additions & 4 deletions src/reanimated2/layoutReanimation/AnimatedRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import { runOnUI } from '../core';
import { withStyleAnimation } from '../animations';

let REALayoutView;
let REALayoutView: any;
if (Platform.OS === 'web' && !requireNativeComponent) {
REALayoutView = React.Component;
} else {
Expand All @@ -24,7 +24,7 @@ export class AnimatedLayout extends React.Component {
runOnUI(() => {
'worklet';

const configs = {};
const configs: Record<string, any> = {};

global.LayoutAnimationRepository = {
configs,
Expand All @@ -44,14 +44,14 @@ runOnUI(() => {
}

const style = configs[tag][type](yogaValues);
const sv = configs[tag].sv;
const sv: { value: boolean; _value: boolean } = configs[tag].sv;
_stopObservingProgress(tag, false);
_startObservingProgress(tag, sv);
sv._value = Object.assign({}, sv._value, style.initialValues);
_stopObservingProgress(tag, false);
const animation = withStyleAnimation(style.animations);

animation.callback = (finished) => {
animation.callback = (finished: boolean) => {
if (finished) {
_stopObservingProgress(tag, finished);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export class BaseAnimationBuilder {
restSpeedThresholdV?: number;

static createInstance: () => BaseAnimationBuilder;
build: EntryExitAnimationBuild;
build: EntryExitAnimationBuild = () => {
throw Error('Unimplemented method in child class.');
};

static duration(durationMs: number): BaseAnimationBuilder {
const instance = this.createInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import {
} from './commonTypes';

export class BaseBounceAnimationBuilder {
durationV: number;
delayV: number;
durationV?: number;
delayV?: number;

static createInstance: () => BaseBounceAnimationBuilder;
build: EntryExitAnimationBuild;
build: EntryExitAnimationBuild = () => {
throw Error('Unimplemented method in child class.');
};

static duration(durationMs: number): BaseBounceAnimationBuilder {
const instance = this.createInstance();
Expand Down

0 comments on commit 1d00b99

Please sign in to comment.