Merge pull request #669 Typescript definitions: added null to return types of functions that may return null